Internal problem ID [7467]
Internal file name [OUTPUT/6434_Sunday_June_19_2022_05_02_20_PM_32081568/index.tex
]
Book: Second order enumerated odes
Section: section 2
Problem number: 26.
ODE order: 2.
ODE degree: 1.
The type(s) of ODE detected by this program : "second_order_change_of_variable_on_x_method_1", "second_order_change_of_variable_on_x_method_2"
Maple gives the following as the ode type
[[_2nd_order, _linear, _nonhomogeneous]]
\[ \boxed {y^{\prime \prime }+\left (1-\frac {1}{x}\right ) y^{\prime }+4 x^{2} y \,{\mathrm e}^{-2 x}=4 \left (x^{3}+x^{2}\right ) {\mathrm e}^{-3 x}} \]
This is second order non-homogeneous ODE. Let the solution be \[ y = y_h + y_p \] Where \(y_h\) is the solution to the homogeneous ODE \( A y''(x) + B y'(x) + C y(x) = 0\), and \(y_p\) is a particular solution to the non-homogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). \(y_h\) is the solution to \[ y^{\prime \prime }+\frac {\left (x -1\right ) y^{\prime }}{x}+4 x^{2} y \,{\mathrm e}^{-2 x} = 0 \] In normal form the ode \begin {align*} y^{\prime \prime }+\frac {\left (x -1\right ) y^{\prime }}{x}+4 x^{2} y \,{\mathrm e}^{-2 x}&=0 \tag {1} \end {align*}
Becomes \begin {align*} y^{\prime \prime }+p \left (x \right ) y^{\prime }+q \left (x \right ) y&=0 \tag {2} \end {align*}
Where \begin {align*} p \left (x \right )&=1-\frac {1}{x}\\ q \left (x \right )&=4 x^{2} {\mathrm e}^{-2 x} \end {align*}
Applying change of variables \(\tau = g \left (x \right )\) to (2) gives \begin {align*} \frac {d^{2}}{d \tau ^{2}}y \left (\tau \right )+p_{1} \left (\frac {d}{d \tau }y \left (\tau \right )\right )+q_{1} y \left (\tau \right )&=0 \tag {3} \end {align*}
Where \(\tau \) is the new independent variable, and \begin {align*} p_{1} \left (\tau \right ) &=\frac {\tau ^{\prime \prime }\left (x \right )+p \left (x \right ) \tau ^{\prime }\left (x \right )}{{\tau ^{\prime }\left (x \right )}^{2}}\tag {4} \\ q_{1} \left (\tau \right ) &=\frac {q \left (x \right )}{{\tau ^{\prime }\left (x \right )}^{2}}\tag {5} \end {align*}
Let \(p_{1} = 0\). Eq (4) simplifies to \begin {align*} \tau ^{\prime \prime }\left (x \right )+p \left (x \right ) \tau ^{\prime }\left (x \right )&=0 \end {align*}
This ode is solved resulting in \begin {align*} \tau &= \int {\mathrm e}^{-\left (\int p \left (x \right )d x \right )}d x\\ &= \int {\mathrm e}^{-\left (\int \left (1-\frac {1}{x}\right )d x \right )}d x\\ &= \int e^{-x +\ln \left (x \right )} \,dx\\ &= \int x \,{\mathrm e}^{-x}d x\\ &= -\left (1+x \right ) {\mathrm e}^{-x}\tag {6} \end {align*}
Using (6) to evaluate \(q_{1}\) from (5) gives \begin {align*} q_{1} \left (\tau \right ) &= \frac {q \left (x \right )}{{\tau ^{\prime }\left (x \right )}^{2}}\\ &= \frac {4 x^{2} {\mathrm e}^{-2 x}}{x^{2} {\mathrm e}^{-2 x}}\\ &= 4\tag {7} \end {align*}
Substituting the above in (3) and noting that now \(p_{1} = 0\) results in \begin {align*} \frac {d^{2}}{d \tau ^{2}}y \left (\tau \right )+q_{1} y \left (\tau \right )&=0 \\ \frac {d^{2}}{d \tau ^{2}}y \left (\tau \right )+4 y \left (\tau \right )&=0 \end {align*}
The above ode is now solved for \(y \left (\tau \right )\).This is second order with constant coefficients homogeneous ODE. In standard form the ODE is \[ A y''(\tau ) + B y'(\tau ) + C y(\tau ) = 0 \] Where in the above \(A=1, B=0, C=4\). Let the solution be \(y \left (\tau \right )=e^{\lambda \tau }\). Substituting this into the ODE gives \[ \lambda ^{2} {\mathrm e}^{\lambda \tau }+4 \,{\mathrm e}^{\lambda \tau } = 0 \tag {1} \] Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda \tau }\) gives \[ \lambda ^{2}+4 = 0 \tag {2} \] Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula \[ \lambda _{1,2} = \frac {-B}{2 A} \pm \frac {1}{2 A} \sqrt {B^2 - 4 A C} \] Substituting \(A=1, B=0, C=4\) into the above gives \begin {align*} \lambda _{1,2} &= \frac {0}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {0^2 - (4) \left (1\right )\left (4\right )}\\ &= \pm 2 i \end {align*}
Hence \begin {align*} \lambda _1 &= + 2 i\\ \lambda _2 &= - 2 i \end {align*}
Which simplifies to \begin{align*} \lambda _1 &= 2 i \\ \lambda _2 &= -2 i \\ \end{align*} Since roots are complex conjugate of each others, then let the roots be \[ \lambda _{1,2} = \alpha \pm i \beta \] Where \(\alpha =0\) and \(\beta =2\). Therefore the final solution, when using Euler relation, can be written as \[ y \left (\tau \right ) = e^{\alpha \tau } \left ( c_{1} \cos (\beta \tau ) + c_{2} \sin (\beta \tau ) \right ) \] Which becomes \[ y \left (\tau \right ) = e^{0}\left (c_{1} \cos \left (2 \tau \right )+c_{2} \sin \left (2 \tau \right )\right ) \] Or \[ y \left (\tau \right ) = c_{1} \cos \left (2 \tau \right )+c_{2} \sin \left (2 \tau \right ) \] The above solution is now transformed back to \(y\) using (6) which results in \begin {align*} y &= c_{1} \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )-c_{2} \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right ) \end {align*}
Therefore the homogeneous solution \(y_h\) is \[ y_h = c_{1} \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )-c_{2} \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right ) \] The particular solution \(y_p\) can be found using either the method of undetermined coefficients, or the method of variation of parameters. The method of variation of parameters will be used as it is more general and can be used when the coefficients of the ODE depend on \(x\) as well. Let \begin{equation} \tag{1} y_p(x) = u_1 y_1 + u_2 y_2 \end{equation} Where \(u_1,u_2\) to be determined, and \(y_1,y_2\) are the two basis solutions (the two linearly independent solutions of the homogeneous ODE) found earlier when solving the homogeneous ODE as \begin{align*} y_1 &= -4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \\ y_2 &= 4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \\ \end{align*} In the Variation of parameters \(u_1,u_2\) are found using \begin{align*} \tag{2} u_1 &= -\int \frac {y_2 f(x)}{a W(x)} \\ \tag{3} u_2 &= \int \frac {y_1 f(x)}{a W(x)} \\ \end{align*} Where \(W(x)\) is the Wronskian and \(a\) is the coefficient in front of \(y''\) in the given ODE. The Wronskian is given by \(W= \begin {vmatrix} y_1 & y_{2} \\ y_{1}^{\prime } & y_{2}^{\prime } \end {vmatrix} \). Hence \[ W = \begin {vmatrix} -4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) & 4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \\ \frac {d}{dx}\left (-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) & \frac {d}{dx}\left (4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) \end {vmatrix} \] Which gives \[ W = \begin {vmatrix} -4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) & 4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \\ -8 \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right )+4 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-4 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+8 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )-2 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x}+2 \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) & 8 \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )-8 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )-4 \cos \left ({\mathrm e}^{-x}\right ) {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )+4 \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )+4 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \end {vmatrix} \] Therefore \[ W = \left (-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right )\left (8 \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )-8 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )-4 \cos \left ({\mathrm e}^{-x}\right ) {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )+4 \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )+4 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right )\right ) - \left (4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right )\left (-8 \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right )+4 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-4 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+8 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )-2 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x}+2 \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right )\right ) \] Which simplifies to \[ W = \text {Expression too large to display} \] Which simplifies to \[ W = -2 x \,{\mathrm e}^{-x} \] Therefore Eq. (2) becomes \[ u_1 = -\int \frac {4 \left (4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) x^{2} \left (1+x \right ) {\mathrm e}^{-3 x}}{-2 x \,{\mathrm e}^{-x}}\,dx \] Which simplifies to \[ u_1 = - \int 2 x \left (1+x \right ) {\mathrm e}^{-2 x} \left (\sin \left (2 \,{\mathrm e}^{-x}\right ) \sin \left (2 x \,{\mathrm e}^{-x}\right )-\cos \left (2 \,{\mathrm e}^{-x}\right ) \cos \left (2 x \,{\mathrm e}^{-x}\right )\right )d x \] Hence \[ u_1 = -\frac {i \left (1+x \right ) {\mathrm e}^{2 i {\mathrm e}^{-x} \left (-x -1\right )-x}}{2}-\frac {i \left (-x -1\right ) {\mathrm e}^{2 i \left (1+x \right ) {\mathrm e}^{-x}-x}}{2}+\frac {\cos \left (2\right )}{2}+\sin \left (2\right )-\frac {\cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2} \] And Eq. (3) becomes \[ u_2 = \int \frac {4 \left (-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) x^{2} \left (1+x \right ) {\mathrm e}^{-3 x}}{-2 x \,{\mathrm e}^{-x}}\,dx \] Which simplifies to \[ u_2 = \int 2 x \left (1+x \right ) {\mathrm e}^{-2 x} \left (\sin \left (2 \,{\mathrm e}^{-x}\right ) \cos \left (2 x \,{\mathrm e}^{-x}\right )+\cos \left (2 \,{\mathrm e}^{-x}\right ) \sin \left (2 x \,{\mathrm e}^{-x}\right )\right )d x \] Hence \[ u_2 = \frac {\left (1+x \right ) {\mathrm e}^{2 i {\mathrm e}^{-x} \left (-x -1\right )-x}}{2}+\frac {\left (1+x \right ) {\mathrm e}^{2 i \left (1+x \right ) {\mathrm e}^{-x}-x}}{2}-\cos \left (2\right )+\frac {\sin \left (2\right )}{2}-\frac {\sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2} \] Therefore the particular solution, from equation (1) is \[ y_p(x) = \left (-\frac {i \left (1+x \right ) {\mathrm e}^{2 i {\mathrm e}^{-x} \left (-x -1\right )-x}}{2}-\frac {i \left (-x -1\right ) {\mathrm e}^{2 i \left (1+x \right ) {\mathrm e}^{-x}-x}}{2}+\frac {\cos \left (2\right )}{2}+\sin \left (2\right )-\frac {\cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}\right ) \left (-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right )+\left (\frac {\left (1+x \right ) {\mathrm e}^{2 i {\mathrm e}^{-x} \left (-x -1\right )-x}}{2}+\frac {\left (1+x \right ) {\mathrm e}^{2 i \left (1+x \right ) {\mathrm e}^{-x}-x}}{2}-\cos \left (2\right )+\frac {\sin \left (2\right )}{2}-\frac {\sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}\right ) \left (4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) \] Which simplifies to \[ y_p(x) = \frac {\left (-2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x} \] Therefore the general solution is \begin{align*} y &= y_h + y_p \\ &= \left (c_{1} \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )-c_{2} \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )\right ) + \left (\frac {\left (-2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x}\right ) \\ \end{align*}
The solution(s) found are the following \begin{align*} \tag{1} y &= c_{1} \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )-c_{2} \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )+\frac {\left (-2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x} \\ \end{align*}
Verification of solutions
\[ y = c_{1} \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )-c_{2} \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )+\frac {\left (-2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x} \] Verified OK.
This is second order non-homogeneous ODE. In standard form the ODE is \[ A y''(x) + B y'(x) + C y(x) = f(x) \] Where \(A=1, B=\frac {x -1}{x}, C=4 x^{2} {\mathrm e}^{-2 x}, f(x)=4 x^{2} \left (1+x \right ) {\mathrm e}^{-3 x}\). Let the solution be \[ y = y_h + y_p \] Where \(y_h\) is the solution to the homogeneous ODE \( A y''(x) + B y'(x) + C y(x) = 0\), and \(y_p\) is a particular solution to the non-homogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). Solving for \(y_h\) from \[ y^{\prime \prime }+\frac {\left (x -1\right ) y^{\prime }}{x}+4 x^{2} y \,{\mathrm e}^{-2 x} = 0 \] In normal form the ode \begin {align*} y^{\prime \prime }+\frac {\left (x -1\right ) y^{\prime }}{x}+4 x^{2} y \,{\mathrm e}^{-2 x}&=0 \tag {1} \end {align*}
Becomes \begin {align*} y^{\prime \prime }+p \left (x \right ) y^{\prime }+q \left (x \right ) y&=0 \tag {2} \end {align*}
Where \begin {align*} p \left (x \right )&=\frac {x -1}{x}\\ q \left (x \right )&=4 x^{2} {\mathrm e}^{-2 x} \end {align*}
Applying change of variables \(\tau = g \left (x \right )\) to (2) results \begin {align*} \frac {d^{2}}{d \tau ^{2}}y \left (\tau \right )+p_{1} \left (\frac {d}{d \tau }y \left (\tau \right )\right )+q_{1} y \left (\tau \right )&=0 \tag {3} \end {align*}
Where \(\tau \) is the new independent variable, and \begin {align*} p_{1} \left (\tau \right ) &=\frac {\tau ^{\prime \prime }\left (x \right )+p \left (x \right ) \tau ^{\prime }\left (x \right )}{{\tau ^{\prime }\left (x \right )}^{2}}\tag {4} \\ q_{1} \left (\tau \right ) &=\frac {q \left (x \right )}{{\tau ^{\prime }\left (x \right )}^{2}}\tag {5} \end {align*}
Let \(q_1=c^2\) where \(c\) is some constant. Therefore from (5) \begin {align*} \tau ' &= \frac {1}{c}\sqrt {q}\\ &= \frac {2 \sqrt {x^{2} {\mathrm e}^{-2 x}}}{c}\tag {6} \\ \tau '' &= \frac {2 \,{\mathrm e}^{-2 x} x -2 x^{2} {\mathrm e}^{-2 x}}{c \sqrt {x^{2} {\mathrm e}^{-2 x}}} \end {align*}
Substituting the above into (4) results in \begin {align*} p_{1} \left (\tau \right ) &=\frac {\tau ^{\prime \prime }\left (x \right )+p \left (x \right ) \tau ^{\prime }\left (x \right )}{{\tau ^{\prime }\left (x \right )}^{2}}\\ &=\frac {\frac {2 \,{\mathrm e}^{-2 x} x -2 x^{2} {\mathrm e}^{-2 x}}{c \sqrt {x^{2} {\mathrm e}^{-2 x}}}+\frac {x -1}{x}\frac {2 \sqrt {x^{2} {\mathrm e}^{-2 x}}}{c}}{\left (\frac {2 \sqrt {x^{2} {\mathrm e}^{-2 x}}}{c}\right )^2} \\ &=0 \end {align*}
Therefore ode (3) now becomes \begin {align*} y \left (\tau \right )'' + p_1 y \left (\tau \right )' + q_1 y \left (\tau \right ) &= 0 \\ \frac {d^{2}}{d \tau ^{2}}y \left (\tau \right )+c^{2} y \left (\tau \right ) &= 0 \tag {7} \end {align*}
The above ode is now solved for \(y \left (\tau \right )\). Since the ode is now constant coefficients, it can be easily solved to give \begin {align*} y \left (\tau \right ) &= c_{1} \cos \left (c \tau \right )+c_{2} \sin \left (c \tau \right ) \end {align*}
Now from (6) \begin {align*} \tau &= \int \frac {1}{c} \sqrt q \,dx \\ &= \frac {\int 2 \sqrt {x^{2} {\mathrm e}^{-2 x}}d x}{c}\\ &= -\frac {2 \left (1+x \right ) \sqrt {x^{2} {\mathrm e}^{-2 x}}}{c x} \end {align*}
Substituting the above into the solution obtained gives \[ y = c_{1} \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )-c_{2} \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right ) \] Now the particular solution to this ODE is found \[ y^{\prime \prime }+\frac {\left (x -1\right ) y^{\prime }}{x}+4 x^{2} y \,{\mathrm e}^{-2 x} = 4 x^{2} \left (1+x \right ) {\mathrm e}^{-3 x} \] The particular solution \(y_p\) can be found using either the method of undetermined coefficients, or the method of variation of parameters. The method of variation of parameters will be used as it is more general and can be used when the coefficients of the ODE depend on \(x\) as well. Let \begin{equation} \tag{1} y_p(x) = u_1 y_1 + u_2 y_2 \end{equation} Where \(u_1,u_2\) to be determined, and \(y_1,y_2\) are the two basis solutions (the two linearly independent solutions of the homogeneous ODE) found earlier when solving the homogeneous ODE as \begin{align*} y_1 &= -4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \\ y_2 &= 4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \\ \end{align*} In the Variation of parameters \(u_1,u_2\) are found using \begin{align*} \tag{2} u_1 &= -\int \frac {y_2 f(x)}{a W(x)} \\ \tag{3} u_2 &= \int \frac {y_1 f(x)}{a W(x)} \\ \end{align*} Where \(W(x)\) is the Wronskian and \(a\) is the coefficient in front of \(y''\) in the given ODE. The Wronskian is given by \(W= \begin {vmatrix} y_1 & y_{2} \\ y_{1}^{\prime } & y_{2}^{\prime } \end {vmatrix} \). Hence \[ W = \begin {vmatrix} -4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) & 4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \\ \frac {d}{dx}\left (-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) & \frac {d}{dx}\left (4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) \end {vmatrix} \] Which gives \[ W = \begin {vmatrix} -4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) & 4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \\ -8 \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right )+4 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-4 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+8 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )-2 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x}+2 \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) & 8 \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )-8 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )-4 \cos \left ({\mathrm e}^{-x}\right ) {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )+4 \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )+4 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \end {vmatrix} \] Therefore \[ W = \left (-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right )\left (8 \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )-8 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )-4 \cos \left ({\mathrm e}^{-x}\right ) {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )+4 \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )+4 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right )\right ) - \left (4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right )\left (-8 \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) {\mathrm e}^{-x} \sin \left ({\mathrm e}^{-x}\right )-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right )+4 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-4 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+8 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right ) \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right )-2 \,{\mathrm e}^{-x} \cos \left ({\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right )^{2} {\mathrm e}^{-x}+2 \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \sin \left (x \,{\mathrm e}^{-x}\right )^{2} \left ({\mathrm e}^{-x}-x \,{\mathrm e}^{-x}\right )\right ) \] Which simplifies to \[ W = \text {Expression too large to display} \] Which simplifies to \[ W = -2 x \,{\mathrm e}^{-x} \] Therefore Eq. (2) becomes \[ u_1 = -\int \frac {4 \left (4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) x^{2} \left (1+x \right ) {\mathrm e}^{-3 x}}{-2 x \,{\mathrm e}^{-x}}\,dx \] Which simplifies to \[ u_1 = - \int 2 x \left (1+x \right ) {\mathrm e}^{-2 x} \left (\sin \left (2 \,{\mathrm e}^{-x}\right ) \sin \left (2 x \,{\mathrm e}^{-x}\right )-\cos \left (2 \,{\mathrm e}^{-x}\right ) \cos \left (2 x \,{\mathrm e}^{-x}\right )\right )d x \] Hence \[ u_1 = -\frac {i \left (1+x \right ) {\mathrm e}^{2 i {\mathrm e}^{-x} \left (-x -1\right )-x}}{2}-\frac {i \left (-x -1\right ) {\mathrm e}^{2 i \left (1+x \right ) {\mathrm e}^{-x}-x}}{2}+\frac {\cos \left (2\right )}{2}+\sin \left (2\right )-\frac {\cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2} \] And Eq. (3) becomes \[ u_2 = \int \frac {4 \left (-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) x^{2} \left (1+x \right ) {\mathrm e}^{-3 x}}{-2 x \,{\mathrm e}^{-x}}\,dx \] Which simplifies to \[ u_2 = \int 2 x \left (1+x \right ) {\mathrm e}^{-2 x} \left (\sin \left (2 \,{\mathrm e}^{-x}\right ) \cos \left (2 x \,{\mathrm e}^{-x}\right )+\cos \left (2 \,{\mathrm e}^{-x}\right ) \sin \left (2 x \,{\mathrm e}^{-x}\right )\right )d x \] Hence \[ u_2 = \frac {\left (1+x \right ) {\mathrm e}^{2 i {\mathrm e}^{-x} \left (-x -1\right )-x}}{2}+\frac {\left (1+x \right ) {\mathrm e}^{2 i \left (1+x \right ) {\mathrm e}^{-x}-x}}{2}-\cos \left (2\right )+\frac {\sin \left (2\right )}{2}-\frac {\sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2} \] Therefore the particular solution, from equation (1) is \[ y_p(x) = \left (-\frac {i \left (1+x \right ) {\mathrm e}^{2 i {\mathrm e}^{-x} \left (-x -1\right )-x}}{2}-\frac {i \left (-x -1\right ) {\mathrm e}^{2 i \left (1+x \right ) {\mathrm e}^{-x}-x}}{2}+\frac {\cos \left (2\right )}{2}+\sin \left (2\right )-\frac {\cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}\right ) \left (-4 \cos \left ({\mathrm e}^{-x}\right )^{2} \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+2 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right )+2 \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right )+\left (\frac {\left (1+x \right ) {\mathrm e}^{2 i {\mathrm e}^{-x} \left (-x -1\right )-x}}{2}+\frac {\left (1+x \right ) {\mathrm e}^{2 i \left (1+x \right ) {\mathrm e}^{-x}-x}}{2}-\cos \left (2\right )+\frac {\sin \left (2\right )}{2}-\frac {\sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}\right ) \left (4 \cos \left ({\mathrm e}^{-x}\right )^{2} \cos \left (x \,{\mathrm e}^{-x}\right )^{2}-2 \cos \left ({\mathrm e}^{-x}\right )^{2}-2 \cos \left (x \,{\mathrm e}^{-x}\right )^{2}+1-4 \sin \left ({\mathrm e}^{-x}\right ) \cos \left ({\mathrm e}^{-x}\right ) \sin \left (x \,{\mathrm e}^{-x}\right ) \cos \left (x \,{\mathrm e}^{-x}\right )\right ) \] Which simplifies to \[ y_p(x) = \frac {\left (-2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x} \] Therefore the general solution is \begin{align*} y &= y_h + y_p \\ &= \left (c_{1} \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )-c_{2} \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )\right ) + \left (\frac {\left (-2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x}\right ) \\ &= c_{1} \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )-c_{2} \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )+\frac {\left (-2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x} \\ \end{align*} Which simplifies to \[ y = \frac {\left (2 c_{1} -2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-2 c_{2} -\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x} \]
The solution(s) found are the following \begin{align*} \tag{1} y &= \frac {\left (2 c_{1} -2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-2 c_{2} -\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x} \\ \end{align*}
Verification of solutions
\[ y = \frac {\left (2 c_{1} -2 \cos \left (2\right )+\sin \left (2\right )\right ) \cos \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\frac {\left (-2 c_{2} -\cos \left (2\right )-2 \sin \left (2\right )\right ) \sin \left (2 \left (1+x \right ) {\mathrm e}^{-x}\right )}{2}+\left (1+x \right ) {\mathrm e}^{-x} \] Verified OK.
Maple trace
`Methods for second order ODEs: --- Trying classification methods --- trying a quadrature trying high order exact linear fully integrable trying differential order: 2; linear nonhomogeneous with symmetry [0,1] trying a double symmetry of the form [xi=0, eta=F(x)] trying symmetries linear in x and y(x) -> Try solving first the homogeneous part of the ODE trying a symmetry of the form [xi=0, eta=F(x)] <- linear_1 successful <- solving first the homogeneous part of the ODE successful`
✓ Solution by Maple
Time used: 0.0 (sec). Leaf size: 39
dsolve(diff(y(x),x$2)+(1-1/x)*diff(y(x),x)+4*x^2*y(x)*exp(-2*x)=4*(x^2+x^3)*exp(-3*x),y(x), singsol=all)
\[ y \left (x \right ) = \sin \left (2 \left (x +1\right ) {\mathrm e}^{-x}\right ) c_{2} +\cos \left (2 \left (x +1\right ) {\mathrm e}^{-x}\right ) c_{1} +{\mathrm e}^{-x} x +{\mathrm e}^{-x} \]
✓ Solution by Mathematica
Time used: 0.604 (sec). Leaf size: 47
DSolve[y''[x]+(1-1/x)*y'[x]+4*x^2*y[x]*Exp[-2*x]==4*(x^2+x^3)*Exp[-3*x],y[x],x,IncludeSingularSolutions -> True]
\[ y(x)\to c_1 \cos \left (2 e^{-x} (x+1)\right )+e^{-x} \left (x-c_2 e^x \sin \left (2 e^{-x} (x+1)\right )+1\right ) \]