2.29 problem 28
Internal
problem
ID
[7813]
Book
:
Own
collection
of
miscellaneous
problems
Section
:
section
2.0
Problem
number
:
28
Date
solved
:
Monday, October 21, 2024 at 04:21:37 PM
CAS
classification
:
[[_2nd_order, _linear, _nonhomogeneous]]
Solve
\begin{align*} y^{\prime \prime }-x y-x^{3}+2&=0 \end{align*}
2.29.1 Solved as second order Airy ode
Time used: 0.052 (sec)
This is Airy ODE. It has the general form
\[ a y^{\prime \prime } + b y^{\prime } + c x y = F(x) \]
Where in this case
\begin{align*} a &= 1\\ b &= 0\\ c &= -1\\ F &= x^{3}-2 \end{align*}
Therefore the solution to the homogeneous Airy ODE becomes
\[
y = c_1 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_2 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )
\]
Since this is inhomogeneous
Airy ODE, then we need to find the particular solution. The particular solution is now found
using the method of undetermined coefficients. Looking at the RHS of the ode, which is
\[ x^{3}+1 \]
Shows that the corresponding undetermined set of the basis functions (UC_set) for the trial
solution is
\[ [\{1, x, x^{2}, x^{3}\}] \]
While the set of the basis functions for the homogeneous solution found earlier is
\[ \left \{\operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right ), \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right \} \]
Since there is no duplication between the basis function in the UC_set and the basis
functions of the homogeneous solution, the trial solution is a linear combination of all the
basis in the UC_set.
\[
y_p = A_{4} x^{3}+A_{3} x^{2}+A_{2} x +A_{1}
\]
The unknowns \(\{A_{1}, A_{2}, A_{3}, A_{4}\}\) are found by substituting the above trial solution \(y_p\) into
the ODE and comparing coefficients. Substituting the trial solution into the ODE
and simplifying gives
\[
6 x A_{4}+2 A_{3}-x \left (A_{4} x^{3}+A_{3} x^{2}+A_{2} x +A_{1}\right )-x^{3}+2 = 0
\]
Solving for the unknowns by comparing coefficients results
in
\[ [A_{1} = 0, A_{2} = 0, A_{3} = -1, A_{4} = 0] \]
Substituting the above back in the above trial solution \(y_p\), gives the particular
solution
\[
y_p = -x^{2}
\]
Therefore the general solution is
\begin{align*}
y &= y_h + y_p \\
&= \left (c_1 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_2 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right ) + \left (-x^{2}\right ) \\
&= c_1 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_2 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )-x^{2} \\
\end{align*}
Will add steps showing solving for IC
soon.
2.29.2 Solved as second order ode adjoint method
Time used: 0.946 (sec)
In normal form the ode
\begin{align*} y^{\prime \prime }-x y-x^{3}+2 = 0 \tag {1} \end{align*}
Becomes
\begin{align*} y^{\prime \prime }+p \left (x \right ) y^{\prime }+q \left (x \right ) y&=r \left (x \right ) \tag {2} \end{align*}
Where
\begin{align*} p \left (x \right )&=0\\ q \left (x \right )&=-x\\ r \left (x \right )&=x^{3}-2 \end{align*}
The Lagrange adjoint ode is given by
\begin{align*} \xi ^{''}-(\xi \, p)'+\xi q &= 0\\ \xi ^{''}-\left (0\right )' + \left (-x \xi \left (x \right )\right ) &= 0\\ \xi ^{\prime \prime }\left (x \right )-x \xi \left (x \right )&= 0 \end{align*}
Which is solved for \(\xi (x)\). This is Airy ODE. It has the general form
\[ a \xi ^{\prime \prime } + b \xi ^{\prime } + c x \xi = F(x) \]
Where in this case
\begin{align*} a &= 1\\ b &= 0\\ c &= -1\\ F &= 0 \end{align*}
Therefore the solution to the homogeneous Airy ODE becomes
\[
\xi = c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )
\]
Will add steps showing
solving for IC soon.
The original ode (2) now reduces to first order ode
\begin{align*} \xi \left (x \right ) y^{\prime }-y \xi ^{\prime }\left (x \right )+\xi \left (x \right ) p \left (x \right ) y&=\int \xi \left (x \right ) r \left (x \right )d x\\ y^{\prime }+y \left (p \left (x \right )-\frac {\xi ^{\prime }\left (x \right )}{\xi \left (x \right )}\right )&=\frac {\int \xi \left (x \right ) r \left (x \right )d x}{\xi \left (x \right )}\\ y^{\prime }-\frac {y \left (-c_5 \left (-1\right )^{{1}/{3}} \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right )-c_6 \left (-1\right )^{{1}/{3}} \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right )\right )}{c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}&=\frac {-2 c_5 x \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )-2 c_6 x \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )-\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}}{2}-\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}}{2}-\frac {c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}}{2}-\frac {c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}}{2}}{c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )} \end{align*}
Which is now a first order ode. This is now solved for \(y\). In canonical form a linear first order
is
\begin{align*} y^{\prime } + q(x)y &= p(x) \end{align*}
Comparing the above to the given ode shows that
\begin{align*} q(x) &=\frac {2 c_5 \left (-1\right )^{{1}/{3}} \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right )+2 c_6 \left (-1\right )^{{1}/{3}} \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right )}{2 c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+2 c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}\\ p(x) &=-\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+4 c_5 x \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+4 c_6 x \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}{2 \left (c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right )} \end{align*}
The integrating factor \(\mu \) is
\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int \frac {2 c_5 \left (-1\right )^{{1}/{3}} \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right )+2 c_6 \left (-1\right )^{{1}/{3}} \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right )}{2 c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+2 c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}d x}\\ &= \frac {1}{c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )} \end{align*}
The ode becomes
\begin{align*}
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \mu p \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (-\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+4 c_5 x \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+4 c_6 x \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}{2 \left (c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right )}\right ) \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (\frac {y}{c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )}\right ) &= \left (\frac {1}{c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )}\right ) \left (-\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+4 c_5 x \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+4 c_6 x \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}{2 \left (c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right )}\right ) \\
\mathrm {d} \left (\frac {y}{c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )}\right ) &= \left (-\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+4 c_5 x \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+4 c_6 x \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}{2 \left (c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right ) \left (c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )\right )}\right )\, \mathrm {d} x \\
\end{align*}
Integrating gives
\begin{align*} \frac {y}{c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )}&= \int {-\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+4 c_5 x \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+4 c_6 x \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}{2 \left (c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right ) \left (c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )\right )} \,dx} \\ &=\int -\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+4 c_5 x \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+4 c_6 x \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}{2 \left (c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right ) \left (c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )\right )}d x + c_7 \end{align*}
Dividing throughout by the integrating factor \(\frac {1}{c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )}\) gives the final solution
\[ y = \left (c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )\right ) \left (\int -\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+4 c_5 x \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+4 c_6 x \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}{2 \left (c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right ) \left (c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )\right )}d x +c_7 \right ) \]
Hence, the solution
found using Lagrange adjoint equation method is
\begin{align*}
y &= \left (c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )\right ) \left (\int -\frac {c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2} \sqrt {-3}+c_5 \operatorname {AiryAi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+c_6 \operatorname {AiryBi}\left (1, -x \left (-1\right )^{{1}/{3}}\right ) x^{2}+4 c_5 x \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+4 c_6 x \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )}{2 \left (c_5 \operatorname {AiryAi}\left (-x \left (-1\right )^{{1}/{3}}\right )+c_6 \operatorname {AiryBi}\left (-x \left (-1\right )^{{1}/{3}}\right )\right ) \left (c_5 \operatorname {AiryAi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )+c_6 \operatorname {AiryBi}\left (-\frac {\left (1+i \sqrt {3}\right ) x}{2}\right )\right )}d x +c_7 \right ) \\
\end{align*}
Will add steps showing solving for IC
soon.
2.29.3 Maple step by step solution
2.29.4 Maple trace
Methods for second order ODEs:
2.29.5 Maple dsolve solution
Solving time : 0.002
(sec)
Leaf size : 18
dsolve(diff(diff(y(x),x),x)-x*y(x)-x^3+2 = 0,
y(x),singsol=all)
\[
y = \operatorname {AiryAi}\left (x \right ) c_2 +\operatorname {AiryBi}\left (x \right ) c_1 -x^{2}
\]
2.29.6 Mathematica DSolve solution
Solving time : 0.456
(sec)
Leaf size : 290
DSolve[{D[y[x],{x,2}]-x*y[x]-x^3+2==0,{}},
y[x],x,IncludeSingularSolutions->True]
\[
y(x)\to \frac {6 \sqrt [3]{3} \pi x \operatorname {Gamma}\left (\frac {1}{3}\right ) \operatorname {Gamma}\left (\frac {5}{3}\right ) \operatorname {Gamma}\left (\frac {7}{3}\right ) \operatorname {Gamma}\left (\frac {8}{3}\right ) \left (\sqrt {3} \operatorname {AiryAi}(x)-\operatorname {AiryBi}(x)\right ) \, _1F_2\left (\frac {1}{3};\frac {2}{3},\frac {4}{3};\frac {x^3}{9}\right )+2 \sqrt [6]{3} \pi x^2 \operatorname {Gamma}\left (\frac {2}{3}\right )^2 \operatorname {Gamma}\left (\frac {7}{3}\right ) \operatorname {Gamma}\left (\frac {8}{3}\right ) \left (3 \operatorname {AiryAi}(x)+\sqrt {3} \operatorname {AiryBi}(x)\right ) \, _1F_2\left (\frac {2}{3};\frac {4}{3},\frac {5}{3};\frac {x^3}{9}\right )+\operatorname {Gamma}\left (\frac {5}{3}\right ) \left (3 \sqrt [3]{3} \pi x^4 \operatorname {Gamma}\left (\frac {4}{3}\right )^2 \operatorname {Gamma}\left (\frac {8}{3}\right ) \left (\operatorname {AiryBi}(x)-\sqrt {3} \operatorname {AiryAi}(x)\right ) \, _1F_2\left (\frac {4}{3};\frac {2}{3},\frac {7}{3};\frac {x^3}{9}\right )+\operatorname {Gamma}\left (\frac {2}{3}\right ) \operatorname {Gamma}\left (\frac {7}{3}\right ) \left (-\sqrt [6]{3} \pi x^5 \operatorname {Gamma}\left (\frac {5}{3}\right ) \left (3 \operatorname {AiryAi}(x)+\sqrt {3} \operatorname {AiryBi}(x)\right ) \, _1F_2\left (\frac {5}{3};\frac {4}{3},\frac {8}{3};\frac {x^3}{9}\right )+27 \operatorname {Gamma}\left (\frac {4}{3}\right ) \operatorname {Gamma}\left (\frac {8}{3}\right ) (c_1 \operatorname {AiryAi}(x)+c_2 \operatorname {AiryBi}(x))\right )\right )}{27 \operatorname {Gamma}\left (\frac {2}{3}\right ) \operatorname {Gamma}\left (\frac {4}{3}\right ) \operatorname {Gamma}\left (\frac {5}{3}\right ) \operatorname {Gamma}\left (\frac {7}{3}\right ) \operatorname {Gamma}\left (\frac {8}{3}\right )}
\]