Hello Everyone,
I am trying to learn Mathematica with a Book, but I have a Problem to Solve an Equation, although I have a AnswerKey of the Examples.
In General i have to solve the equation y''[x]+y'[x]==x²*Sqrt[x],y[x],x].
First i want to solve it with C1 and C2, later i want to replace them and plot the function. Well, I think my ProbleM is the first Part - just solve it with C1 and C2.
My Code is:
DSolveValue[y''[x] + y'[x] == x^2*Sqrt[x], y[x], x]`
The Code is exactly the same as in the AnswerKey to this Example, but as a solution I get:
(2 x^(7/2))/7 - E^-x C[1] + C[2] + (
E^-x Sqrt[-x] Gamma[7/2, -x])/Sqrt[x]
the “Right” solution from the answer Key should be:
C[2] + 1/56 E^-x*(2*(E^x*Sqrt[x]*(-105 + 70 x - 28 x^2 + 8 x^3) -
28*C[1]) + 105*Sqrt[Pi]*Erfi[Sqrt[x]])
So the most obvious difference for me is that “Erfi” function in die Solution and in my solution there is a “Gamma” function. I already made some Research About them but didn’t really understood what they do. Furthermore, I don’t get why my solution differ from the Answerkey one, although I have the same Input.
In the Attachments is my Mathematica file (it is the first Input) and a PDF of the AnswerKey how the solution should look like.
I hope someone can tell me what to do.
Problem Chapter 16.nb (65.5 KB)
Solution 4.pdf (33.7 KB)
Try:
eq = y''[x] + y'[x] == x^2*Sqrt[x];
sol = DSolve[eq, y, x]
(* {{y -> Function[{x}, (2 x^(7/2))/7 - E^-x C[1] + C[2] + (
E^-x Sqrt[-x] Gamma[7/2, -x])/Sqrt[x]]}} *)
eq /. sol // FullSimplify(*Solution is Correct*)
(* {True}*)
Using FunctionExpand to get Erfi[x] function:
sol2 = DSolveValue[eq, y[x], x] // FunctionExpand // Simplify
(*-((15 Sqrt[x])/4) + (5 x^(3/2))/2 - x^(5/2) + (2 x^(7/2))/7 +
E^-x ((15 Sqrt[\[Pi]] Sqrt[-x])/(8 Sqrt[x]) - C[1]) + C[2] +
15/8 E^-x Sqrt[\[Pi]] Erfi[Sqrt[x]] *)
eq /. {{y -> Function[{x}, Evaluate@sol2]}} // FullSimplify(*Solution is correct*)
(* {True}*)
Check if yours solution are correct:
eq /. {{y ->
Function[{x},
C[2] + 1/
56 E^-x (2 (E^x Sqrt[x] (-105 + 70 x - 28 x^2 + 8 x^3) -
28 C[1]) + 105 Sqrt[Pi]*Erfi[Sqrt[x]])]}} // FullSimplify
(* {True}*)
Regards M.I.
Hello Mr. Iwaniuk,
Thanks for your Reply 
I tried it, and have the same Solution than you.
but if i replace the C1 and C2, and want to plot it, it seems that the Solution is different to the Solution from the Answerkey.
If i Plot with the Code of your solution, i need to plot from {x,0,100} to see the graph. In the solution it should start from ~0
In the Attachments are the Solutions from the Answerkey again 
Do you have any idea whats going on there? Thanks for your help.
Chatper 16 - Exercises.nb (11 KB)
It’s seems both solution are correct only for Real numbers.
See attached file.
Chatper 16 - Exercises-ver1.nb (67.6 KB)
Ah okay, I never would have thought about this.
Thanks a Lot for your help 
I really appreciate it.