Solve the following differential equation $x^2\frac{d^2y}{dx^2}+4x\frac{dy}{dx}+2y=e^x.$

Solve the following differential equation $$x^2\frac{d^2y}{dx^2}+4x\frac{dy}{dx}+2y=e^x.$$

I tried solving this problem as follows:

Given, $$x^2\frac{d^2y}{dx^2}+4x\frac{dy}{dx}+2y=e^x.$$ This is a Cauchy-Euler Equation because it is of the form $$\frac{d^ny}{dx^n}+ p_1x^{n-1}\frac{d^{n-1}y}{dx^{n-1}}+p_2x^{n-2}\frac{d^{n-2}y}{dx^{n-2}}+\cdots +p_{n-1}x\frac{dy}{dx}+p_ny=X,$$ where the $$p_i's$$ are constants and $$X$$ is a function of $$x.$$

We try to change the variables from $$x$$ to $$z$$ by using the transformation $$x=e^z\implies z=\log x.$$

Now, $$\frac{dy}{dx}=\frac{dy}{dz}\frac{dz}{dx}=\frac{dy}{dz}\frac 1x,\frac{d^2y}{dx^2}=\frac{d(\frac{dy}{dz}\frac 1x)}{dx}=\frac 1x\frac{d(\frac{dy}{dz})}{dx}-\frac1{x^2}\frac{dy}{dz}=\frac{1}{x^2}\frac{d^2y}{dz^2}-\frac{1}{x^2}\frac{dy}{dz}=\frac{1}{x^2}(\frac{d^2y}{dz^2}-\frac{dy}{dz})$$.

Using these values we have, $$x^2\frac{d^2y}{dx^2}+4x\frac{dy}{dx}+2y=e^x\implies \frac{d^2y}{dz^2}+3\frac{dy}{dz}+2y=e^{e^z}.$$

But here's the problem, I successfully converted the given differential equation into a linear differential equation with constant coefficients. But the problem arises when we try to calculate the particular integral as follows:

We have, $$\frac{d^2y}{dz^2}+3\frac{dy}{dz}+2y=e^{e^z}.$$ Hence, if $$f(D)$$ is the differential operator then, in this case $$f(D)=D^2+3D+2$$ so, $$f(D)y=e^{e^z}.$$

Now, $$y_p=\frac{1}{f(D)}e^{e^z}\implies y_p=\frac{1}{f(D)}e^{e^z},$$ where $$y_p$$ is the particular integral.

But I don't understand how to evaluate $$y_p=\frac{1}{f(D)}e^{e^z}.$$ I know that, $$\frac{1}{f(D)}e^{ax}=\frac{1}{f(a)}e^{ax}$$, but this doesn't seem to apply here. Any help regarding the way to evaluate this, will be greatly appreciated.

\begin{align} x^2D^2+4xD+2 &=(xD)^2+3xD+2\tag{1a}\\[6pt] &=(xD+1)(xD+2)\tag{1b}\\ &=(Dx)\left(\frac1xDx^2\right)\tag{1c}\\ &=D^2x^2\tag{1d} \end{align} Explanation:
$$\text{(1a):}$$ $$(xD)^2=x^2D^2+xD$$
$$\text{(1b):}$$ factor operators
$$\text{(1c):}$$ rewrite operators
$$\text{(1d):}$$ combine operators

Applying $$(1)$$, we get \begin{align} \left(x^2D^2+4xD+2\right)y&=e^x\tag{2a}\\[3pt] D^2x^2y&=e^x\tag{2b}\\[3pt] x^2y&=e^x+ax+b\tag{2c}\\ y&=\frac{e^x-1-x}{x^2}\tag{2d} \end{align} Explanation:
$$\text{(2b):}$$ apply $$(1)$$
$$\text{(2c):}$$ integrate twice
$$\text{(2d):}$$ $$a=b=1$$ gives a smooth $$y$$ near $$x=0$$

$$x^2\frac{d^2y}{dx^2}+4x\frac{dy}{dx}+2y=e^x.$$ $$(x^2y')'+2(xy)'=e^x$$ $$(x^2y'+2xy)'=e^x$$ $$(x^2y)''=e^x$$ Integrate twice.

• I liked your method but any idea how to find $$\frac 1{f(D)}e^{e^z}$$ ? Commented Jun 20, 2023 at 4:55
• You're welcome note that you can multiply by $e^z$ thats an integrating factor then use the inverse operator method @ThomasFinley Commented Jun 20, 2023 at 8:56

$$\boxed{\frac{1}{D+m}f(x)=e^{-mx}\int e^{mx}f(x) dx}$$

Hint: Solve the first order linear ode $$(D+m)y=f(x)$$

\begin{align}y_p=\frac{1}{f(D)}e^{e^z}&=\frac{1}{D^2+3D+2}e^{e^z}\\&=\frac{1}{D+2}\big[\frac{1}{D+1}e^{e^z}\big]\\&=? \end{align}

• But the problem is, I am aware that $$\frac 1{D-m}X=y_p\implies y_p=e^{mx}\int e^{-mx}X,$$ but the thing is, how are you gonna find the value of $$\frac{1}{D+1}e^{e^z}=p\implies p=e^{-z}\int e^ze^{e^z}$$? Precisely the portion $$\int e^ze^{e^z}$$ , looks challenging to evaluate. Commented Jun 20, 2023 at 4:53
• Substitute $e^z=t$ Commented Jun 20, 2023 at 4:55
• Good idea! Doin it. Commented Jun 20, 2023 at 4:56
• Thanks! Got the answer $\frac{1}{D+1}e^{e^z}=e^{-z}e^{e^z}$. Commented Jun 20, 2023 at 5:01
• Wow. Celebrate :) Commented Jun 20, 2023 at 5:02