0

How can I solve this NODE in series

y''[x]^2 + (1/2)*y'[x] + (1/2) y[x] == p x + q.

`p`  and `q` are constant.

But do not know how to actually solve it with series. Any suggestion?

Bahram Agheli
  • 504
  • 2
  • 12
  • You have two answers here as well as some informative comments. http://mathematica.stackexchange.com/questions/25363/solving-an-ode-in-power-series – PlatoManiac Jul 23 '15 at 13:02
  • This code is incorrect. Output is: "The supplied equation in !(Function[{y, x}, {y[x] -
    *SuperscriptBox["y", "[Prime]", MultilineFunction->None][x] + *SuperscriptBox[ RowBox[{SuperscriptBox["y", "[Prime][Prime]", MultilineFunction->None], "[", "x", "]"}], "2"] == 0,
    *SuperscriptBox["y", "[Prime]", MultilineFunction->None][0] == 1, y[0] == 0}]) is not a linear
    differential equation with polynomial coefficients. "
    – Bahram Agheli Jul 23 '15 at 17:48

1 Answers1

2

It's works with the assumed n! Lets n = 5.

n = 5;
y = Sum[c[i]*x^i, {i, 0, n}] + O[x]^(n + 1);
ODE = (D[y, {x, 2}])^2 + 1/2*D[y, x] + 1/2*y - p*x - q == 0;
Y = FullSimplify@
Normal[y /. Solve[LogicalExpand[ODE], Table[c[i], {i, 1, n}]]] // 
Quiet

Solution:

$${\frac{-10 c(2) x^5 (c(0)+2 p-2 q)^2+3 x^5 (c(0)+2 p-2 q)^3-32 c(2)^3 x^4 (3 x-5) (c(0)+2 p-2 q)+8 c(2)^2 x^4 (c(0)+2 p-2 q) (c(0) (9 x-10)+2 p (9 x-10)+q (20-18 x)+x)+64 c(2)^4 x^3 (x (9 x-20)+80) (c(0)+2 p-2 q)-128 c(2)^5 \left(1920 c(0) (x-1)-3840 q x+(x (x+10)+80) x^3\right)+512 c(2)^6 x^2 (x (x (3 x-10)+80)+480)-1966080 c(2)^7 x}{245760 c(2)^5}}$$

And check the solution.Let's:

$$\left\{y(0)=1,y'(0)=1,p=1,q=2\right\}$$

 Sol = First@
 Solve[{Y == 1 /. x -> 0, D[Y, x] == 1 /. x -> 0}, {c[0], 
 c[2]}] /. {p -> 1, q -> 2}
 YY = Y /. Sol /. {p -> 1, q -> 2}
 ZZ = First@
 With[{p = 1, q = 2}, 
 NDSolve[{z''[x]^2 + 1/2*z'[x] + 1/2*z[x] == p*x + q, z[0] == 1, 
 z'[0] == 1}, z, {x, -2, 2}]]
 Plot[{YY, z[x] /. ZZ}, {x, -2, 2}, PlotRange -> All, 
 PlotLegends -> {"Series", "NDSolve"}, 
 PlotStyle -> {Thin, {Thick, Dashed}}]

enter image description here

Mariusz Iwaniuk
  • 13,841
  • 1
  • 25
  • 41