Find the solution for the following differential equation: $y” – y’ = x^2$

ordinary differential equations

I'm trying to find the solution for the following differential equation, however, I'm not sure how to derive the answer and so I would really appreciate some support!

$y'' – y' = x^2$

I have tried splitting this into a quadratic polynomial: $Ax^2 + bx + C$

Then taking its derivative:

$$y'' – y' = x^2 \implies 2Ax + 2A + B =x^2 $$

This is the case when $A = \frac{1}{2}x$ and $B = -x$

$y_1(x) = x^2 + \frac{1}{2}x-x$

Though this is not the solution, because when I place this back into the equation I do not get the right answer.

I thought the solution would be: $y=c_1\cos(x) + c_2\sin(x) + x^2+\frac{1}{2}x-x$

My expectation is: $y=c_1e^x+c_2-2x-x^2-\frac{1}{x}x^3$

Best Answer

You are right with your expectation. Let's first solve the homogeneous equation $y''-y'=0$. It's characteristic polynomial is $x^2-x=0$ which has solutions $x_1=0, x_2=1$. This means the solution for the homogeneous equation is $$y= c_1e^x + c_2e^0 = c_1e^x + c_2$$ For the inhomogeneous equation we have to add a special solution to this general solution of the homogeneous equation. For that we can write the right hand side as $x^2 e^{0x}$. And the formulas about inhomogeneous linear differential equations with constant coefficients tells us that we get a polynomial with degree $\leq 2+1 = 3$ (because the degree of $x^2$ is $2$ and $x_1=0$ is a zero of order $1$ of the characteristic polynomial). So we try $u_{sp}(x) = ax^3+bx^2+cx+d$ to get: $$6ax+2b-3ax^2-2bx-c = x^2$$ which results in $a= \frac{-1}{3}, b=-1, c=-2$ and $d$ can be chosen freely (by comparing the coefficients). So we get as the final solution

$$y(x) = c_1e^x + c_2 - \frac{1}{3}x^3-x^2-2x$$

Related Question