Question: why dsolve returns solution with constant of integration in it, when IC are given?

Should solution to a first order ode with IC not have any constant of integration in it? This is what the teacher said at school.

But Maple in this example returns a solution to first order Riccati ode with c1 still in the solution even though it is given IC.

How is this possible? This is problem from Differential equations and their applications, 3rd ed., M. Braun, Section 1.10. Page 80, problem #5

If dsolve was not able to resolve c1 from IC for some reason, should it not have returned any solution in this case? 

btw, I could not verify the solution on the ode itself using odetest, but may be assumptions are needed. Will try and see...

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 19 and is the same as the version installed in this computer, created May 21, 2025, 13:44 hours Eastern Time.`

Physics:-Version();

 

`The "Physics Updates" version in the MapleCloud is 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

restart;

libname;

"/home/me/maple/toolbox/2025/Physics Updates/lib", "/home/me/maple/toolbox/2025/Maple Customer Support Updates/lib", "/home/me/maple2025/lib"

ode:=diff(y(x),x)=1+y(x)+y(x)^2*cos(x);
IC:=y(0)=0;
maple_sol:=dsolve([ode,IC]);

diff(y(x), x) = 1+y(x)+y(x)^2*cos(x)

y(0) = 0

y(x) = -(1/2)*csgn(sin((1/2)*x))*(MathieuS(-1, -2, arccos(cos((1/2)*x)))*csgn(sin((1/2)*x))*c__1+4*MathieuS(-1, -2, arccos(cos((1/2)*x)))*cos(x)*c__1-MathieuSPrime(-1, -2, arccos(cos((1/2)*x)))*csgn(sin((1/2)*x))*c__1-c__1*MathieuS(-1, -2, arccos(cos((1/2)*x)))+c__1*MathieuSPrime(-1, -2, arccos(cos((1/2)*x)))-MathieuCPrime(-1, -2, arccos(cos((1/2)*x)))*csgn(sin((1/2)*x))+MathieuC(-1, -2, arccos(cos((1/2)*x)))*csgn(sin((1/2)*x))+4*MathieuC(-1, -2, arccos(cos((1/2)*x)))*cos(x)+MathieuCPrime(-1, -2, arccos(cos((1/2)*x)))-MathieuC(-1, -2, arccos(cos((1/2)*x))))/((c__1*MathieuS(-1, -2, arccos(cos((1/2)*x)))-c__1*MathieuSPrime(-1, -2, arccos(cos((1/2)*x)))-MathieuCPrime(-1, -2, arccos(cos((1/2)*x)))+MathieuC(-1, -2, arccos(cos((1/2)*x))))*cos(x))

lprint(maple_sol);

y(x) = -1/2*csgn(sin(1/2*x))/(c__1*MathieuS(-1,-2,arccos(cos(1/2*x)))-c__1*
MathieuSPrime(-1,-2,arccos(cos(1/2*x)))-MathieuCPrime(-1,-2,arccos(cos(1/2*x)))
+MathieuC(-1,-2,arccos(cos(1/2*x))))*(MathieuS(-1,-2,arccos(cos(1/2*x)))*csgn(
sin(1/2*x))*c__1+4*MathieuS(-1,-2,arccos(cos(1/2*x)))*cos(x)*c__1-MathieuSPrime
(-1,-2,arccos(cos(1/2*x)))*csgn(sin(1/2*x))*c__1-c__1*MathieuS(-1,-2,arccos(cos
(1/2*x)))+c__1*MathieuSPrime(-1,-2,arccos(cos(1/2*x)))-MathieuCPrime(-1,-2,
arccos(cos(1/2*x)))*csgn(sin(1/2*x))+MathieuC(-1,-2,arccos(cos(1/2*x)))*csgn(
sin(1/2*x))+4*MathieuC(-1,-2,arccos(cos(1/2*x)))*cos(x)+MathieuCPrime(-1,-2,
arccos(cos(1/2*x)))-MathieuC(-1,-2,arccos(cos(1/2*x))))/cos(x)

 

 

Download why_c_in_solution_may_23_2025.mw

Update

Looked up the textbook, it says solution exist and unique over 0<=x<=1/3, using these now Maple verifies the ode itself, but does not verify the IC (because c__1 is there). Here is updated worksheet. The bottom line, I think the solution is wrong as it should not have any constant of integration in it. Textbook also does say what the solution should be.

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 20. The version installed in this computer is 19 created May 21, 2025, 13:44 hours Eastern Time, found in the directory /home/me/maple/toolbox/2025/Maple Customer Support Updates/lib/Maple`

Physics:-Version();

 

`The "Physics Updates" version in the MapleCloud is 1873 and is the same as the version installed in this computer, created 2025, May 18, 21:44 hours Pacific Time.`

restart;

libname;

"/home/me/maple/toolbox/2025/Physics Updates/lib", "/home/me/maple/toolbox/2025/Maple Customer Support Updates/lib", "/home/me/maple2025/lib"

ode:=diff(y(x),x)=1+y(x)+y(x)^2*cos(x);
IC:=y(0)=0;
maple_sol:=dsolve([ode,IC]):
simplify(maple_sol) assuming x>=0 and x<=1/3;

diff(y(x), x) = 1+y(x)+y(x)^2*cos(x)

y(0) = 0

y(x) = (2*c__1*MathieuS(-1, -2, (1/2)*x)+2*MathieuC(-1, -2, (1/2)*x))/(c__1*MathieuSPrime(-1, -2, (1/2)*x)-c__1*MathieuS(-1, -2, (1/2)*x)+MathieuCPrime(-1, -2, (1/2)*x)-MathieuC(-1, -2, (1/2)*x))

odetest(%,[ode,IC]);

[0, -2/(c__1-1)]

 

 

Download why_c_in_solution_may_23_2025_v2.mw

Please Wait...