Internal problem ID [1141]
Internal file name [OUTPUT/1142_Sunday_June_05_2022_02_03_26_AM_72372577/index.tex
]
Book: Elementary differential equations with boundary value problems. William F. Trench.
Brooks/Cole 2001
Section: Chapter 5 linear second order equations. Section 5.6 Reduction or order. Page
253
Problem number: 35.
ODE order: 2.
ODE degree: 1.
The type(s) of ODE detected by this program : "reduction_of_order", "exact linear second order ode", "second_order_integrable_as_is", "second_order_change_of_variable_on_y_method_1", "linear_second_order_ode_solved_by_an_integrating_factor"
Maple gives the following as the ode type
[[_2nd_order, _exact, _linear, _nonhomogeneous]]
\[ \boxed {\left (x^{2}-4\right ) y^{\prime \prime }+4 y^{\prime } x +2 y=2+x} \] Given that one solution of the ode is \begin {align*} y_1 &= \frac {1}{-2+x} \end {align*}
With initial conditions \begin {align*} \left [y \left (0\right ) = -{\frac {1}{3}}, y^{\prime }\left (0\right ) = -1\right ] \end {align*}
This is a linear ODE. In canonical form it is written as \begin {align*} y^{\prime \prime } + p(x)y^{\prime } + q(x) y &= F \end {align*}
Where here \begin {align*} p(x) &=\frac {4 x}{x^{2}-4}\\ q(x) &=\frac {2}{x^{2}-4}\\ F &=\frac {2+x}{x^{2}-4} \end {align*}
Hence the ode is \begin {align*} y^{\prime \prime }+\frac {4 x y^{\prime }}{x^{2}-4}+\frac {2 y}{x^{2}-4} = \frac {2+x}{x^{2}-4} \end {align*}
The domain of \(p(x)=\frac {4 x}{x^{2}-4}\) is \[
\{-\infty \le x <-2, -2 This is second order nonhomogeneous ODE. In standard form the ODE is \[ A y''(x) + B y'(x) + C y(x) = f(x) \] Where \(A=x^{2}-4, B=4 x, C=2, f(x)=2+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 inhomogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). \(y_h\) is the solution to \[ \left (x^{2}-4\right ) y^{\prime \prime }+4 y^{\prime } x +2 y = 0 \] Given one basis solution \(y_{1}\left (x \right )\), then the
second basis solution is given by \[
y_{2}\left (x \right ) = y_{1} \left (\int \frac {{\mathrm e}^{-\left (\int p d x \right )}}{y_{1}^{2}}d x \right )
\] Where \(p(x)\) is the coefficient of \(y^{\prime }\) when the ode is
written in the normal form \[
y^{\prime \prime }+p \left (x \right ) y^{\prime }+q \left (x \right ) y = f \left (x \right )
\] Looking at the ode to solve shows that \[
p \left (x \right ) = \frac {4 x}{x^{2}-4}
\] Therefore \begin{align*}
y_{2}\left (x \right ) &= \frac {\int {\mathrm e}^{-\left (\int \frac {4 x}{x^{2}-4}d x \right )} \left (-2+x \right )^{2}d x}{-2+x} \\
y_{2}\left (x \right ) &= \frac {1}{-2+x} \int \frac {\frac {1}{\left (x^{2}-4\right )^{2}}}{\frac {1}{\left (-2+x \right )^{2}}} , dx \\
y_{2}\left (x \right ) &= \frac {\int \frac {1}{\left (2+x \right )^{2}}d x}{-2+x} \\
y_{2}\left (x \right ) &= -\frac {1}{\left (-2+x \right ) \left (2+x \right )} \\
\end{align*}
Hence the solution is \begin{align*}
y &= c_{1} y_{1}\left (x \right )+c_{2} y_{2}\left (x \right ) \\
&= \frac {c_{1}}{-2+x}-\frac {c_{2}}{\left (-2+x \right ) \left (2+x \right )} \\
\end{align*} Therefore the homogeneous solution \(y_h\) is \[ y_h = \frac {c_{1}}{-2+x}-\frac {c_{2}}{\left (-2+x \right ) \left (2+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 &= \frac {1}{-2+x} \\
y_2 &= -\frac {1}{\left (-2+x \right ) \left (2+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} \frac {1}{-2+x} & -\frac {1}{\left (-2+x \right ) \left (2+x \right )} \\ \frac {d}{dx}\left (\frac {1}{-2+x}\right ) & \frac {d}{dx}\left (-\frac {1}{\left (-2+x \right ) \left (2+x \right )}\right ) \end {vmatrix} \] Which gives \[ W = \begin {vmatrix} \frac {1}{-2+x} & -\frac {1}{\left (-2+x \right ) \left (2+x \right )} \\ -\frac {1}{\left (-2+x \right )^{2}} & \frac {1}{\left (-2+x \right )^{2} \left (2+x \right )}+\frac {1}{\left (-2+x \right ) \left (2+x \right )^{2}} \end {vmatrix} \] Therefore \[
W = \left (\frac {1}{-2+x}\right )\left (\frac {1}{\left (-2+x \right )^{2} \left (2+x \right )}+\frac {1}{\left (-2+x \right ) \left (2+x \right )^{2}}\right ) - \left (-\frac {1}{\left (-2+x \right ) \left (2+x \right )}\right )\left (-\frac {1}{\left (-2+x \right )^{2}}\right )
\] Which
simplifies to \[
W = \frac {1}{\left (-2+x \right )^{2} \left (2+x \right )^{2}}
\] Which simplifies to \[
W = \frac {1}{\left (-2+x \right )^{2} \left (2+x \right )^{2}}
\] Therefore Eq. (2) becomes \[
u_1 = -\int \frac {-\frac {1}{-2+x}}{\frac {x^{2}-4}{\left (-2+x \right )^{2} \left (2+x \right )^{2}}}\,dx
\] Which simplifies to \[
u_1 = - \int \left (-x -2\right )d x
\]
Hence \[
u_1 = \frac {1}{2} x^{2}+2 x
\] And Eq. (3) becomes \[
u_2 = \int \frac {\frac {2+x}{-2+x}}{\frac {x^{2}-4}{\left (-2+x \right )^{2} \left (2+x \right )^{2}}}\,dx
\] Which simplifies to \[
u_2 = \int \left (2+x \right )^{2}d x
\] Hence \[
u_2 = \frac {\left (2+x \right )^{3}}{3}
\] Therefore the particular
solution, from equation (1) is \[
y_p(x) = \frac {\frac {1}{2} x^{2}+2 x}{-2+x}-\frac {\left (2+x \right )^{2}}{3 \left (-2+x \right )}
\] Which simplifies to \[
y_p(x) = \frac {x^{2}+4 x -8}{-12+6 x}
\] Therefore the general solution is
\begin {align*} y &= y_h + y_p \\ &= \left (\frac {c_{1}}{-2+x}-\frac {c_{2}}{\left (-2+x \right ) \left (2+x \right )}\right ) + \left (\frac {x^{2}+4 x -8}{-12+6 x}\right ) \end {align*}
Which simplifies to \[ y = \frac {c_{1} \left (2+x \right )-c_{2}}{x^{2}-4}+\frac {x^{2}+4 x -8}{-12+6 x} \] Initial conditions are used to solve for the constants of integration.
Looking at the above solution \begin {align*} y = \frac {c_{1} \left (2+x \right )-c_{2}}{x^{2}-4}+\frac {x^{2}+4 x -8}{-12+6 x} \tag {1} \end {align*}
Initial conditions are now substituted in the above solution. This will generate the required
equations to solve for the integration constants. substituting \(y = -{\frac {1}{3}}\) and \(x = 0\) in the above gives
\begin {align*} -{\frac {1}{3}} = \frac {c_{2}}{4}+\frac {2}{3}-\frac {c_{1}}{2}\tag {1A} \end {align*}
Taking derivative of the solution gives \begin {align*} y^{\prime } = \frac {c_{1}}{x^{2}-4}-\frac {2 \left (c_{1} \left (2+x \right )-c_{2} \right ) x}{\left (x^{2}-4\right )^{2}}+\frac {4+2 x}{-12+6 x}-\frac {6 \left (x^{2}+4 x -8\right )}{\left (-12+6 x \right )^{2}} \end {align*}
substituting \(y^{\prime } = -1\) and \(x = 0\) in the above gives \begin {align*} -1 = -\frac {c_{1}}{4}\tag {2A} \end {align*}
Equations {1A,2A} are now solved for \(\{c_{1}, c_{2}\}\). Solving for the constants gives \begin {align*} c_{1}&=4\\ c_{2}&=4 \end {align*}
Substituting these values back in above solution results in \begin {align*} y = \frac {x^{3}+6 x^{2}+24 x +8}{6 \left (-2+x \right ) \left (2+x \right )} \end {align*}
Which simplifies to \[
y = \frac {x^{3}+6 x^{2}+24 x +8}{6 x^{2}-24}
\] The solution(s) found are the following \begin{align*}
\tag{1} y &= \frac {x^{3}+6 x^{2}+24 x +8}{6 x^{2}-24} \\
\end{align*} Verification of solutions
\[
y = \frac {x^{3}+6 x^{2}+24 x +8}{6 x^{2}-24}
\] Verified OK. Maple trace
✓ Solution by Maple
Time used: 0.016 (sec). Leaf size: 27
\[
y \left (x \right ) = \frac {x^{3}+6 x^{2}+24 x +8}{6 x^{2}-24}
\]
✓ Solution by Mathematica
Time used: 0.034 (sec). Leaf size: 30
\[
y(x)\to \frac {-2 x^3-12 x^2+54 x+5}{48-12 x^2}
\]
`Methods for second order ODEs:
--- Trying classification methods ---
trying a quadrature
trying high order exact linear fully integrable
<- high order exact linear fully integrable successful`
dsolve([(x^2-4)*diff(diff(y(x),x),x)+4*x*diff(y(x),x)+2*y(x) = 2+x, 1/(-2+x), y(0) = -1/3, D(y)(0) = -1], singsol=all)
DSolve[(x^2-4)*y''[x]+4*x*y'[x]+2*y[x]==x+2,{y[1]==5/4,y'[1]==3/2},y[x],x,IncludeSingularSolutions -> True]