# Solving a second order non-homogeneous ODE

How do I solve the following non-homogeneous differential equation?

$$x^{2}y''+xy'=x^{2}\ln x$$ and $$y(1)=2$$, $$y'(1)=0$$.

I've started to solve the question in the following way,

Homogeneous equation is:

$$x^{2}y''+xy'=0\tag{2}$$

Let $$x=e^{z}$$ then $$z=\log_e x=\ln x$$

$$y'= \frac{dy}{dx} \quad\Rightarrow\quad \frac{dy}{dz}\frac{dz}{dx}\quad\Rightarrow\quad xy'=\frac{dy}{dz}=Du$$

Similarly,

$$x^{2}y''=D(D-1)y$$

Equation (2) becomes, $${D(D-1)+D}y=0\quad\Rightarrow\quad (D^{2}-D+D)y=0\quad\Rightarrow \quad D^{2}y=0$$

Now I'm stuck for further process.

• You need at least one solution to solve such ODE. – Surb Apr 10 '20 at 9:29
• You can integrate $D^2y=0$ twice to get $y(z)=Az+B$ – Fakemistake Apr 10 '20 at 9:38
• @Fakemistake I'm not sure if I'm fully understanding it. Then if for example if it's $(D-2)^{2}y=0$ then as it's a double solution $2, 2$ then it's $y(z)=Az+B$ too? – Santi Apr 10 '20 at 12:22

The transformed ODE is $$D^2y=ze^{2z}$$

For the solution of corresponding homogeneous equation the solution is $$y_h=az+b=aIn(x)+b$$ (Integrate $$D^2y=0$$ twice)

For the term $$ze^{2z}$$ in RHS, the particular solution is given as

$$y_p= \frac {1}{D^2}ze^{2z}=\int\int ze^{2z}dz$$ etc.

The general solution is $$y(x)=y_h+y_p$$. Can you proceed further?

• Integrate directly without substitution as the operator $D=\frac{d}{dz}$. – Nitin Uniyal Apr 10 '20 at 10:53
• It would be $\frac{(z-1)e^{2z}}{4}=\frac{x^2.(In(x)-1)}{4}$. Drop the integration constant $c$ as it is not a general solution. – Nitin Uniyal Apr 10 '20 at 11:02
• $D^(az+b)=0\implies y=az+b$ where $a$ and $b$ are arbitrary constants of the one degree polynomial. – Nitin Uniyal Apr 10 '20 at 11:29
• You can accept my answer if it fulfils your query by making the tick green. – Nitin Uniyal Apr 10 '20 at 12:04
• For $(D-a)^2y=0$ then roots of auxiliary equation i.e. $(m-2)^2=0$ will be $2,2$. Then $y_h=(a+bz)e^{2z}$. – Nitin Uniyal Apr 10 '20 at 12:29

$$x^2y''+xy'=x^2\ln(x)$$ Why don't you simplify ? $$xy''+y'=x\ln(x)$$ $$(xy')'=x\ln(x)$$ Integrate : $$xy'=\frac12 x^2\ln(x)-\frac14 x^2+c_1$$ Condition : $$y'(1)=0\quad\implies\quad 0=-\frac14+c_1\quad\implies\quad c_1=\frac14$$ $$y'=\frac12 x\ln(x)-\frac14 x+\frac{1}{4x}$$ Integrate : $$y=\frac14 x^2\ln(x)-\frac14 x^2+\frac14 \ln(x)+c_2$$ Condition : $$y(1)=2\quad\implies\quad 2=-\frac14 +c_2\quad\implies\quad c_2=\frac94$$ $$y=\frac14 x^2\ln(x)-\frac14 x^2+\frac14 \ln(x)+\frac94$$