Internal problem ID [6172]
Internal file name [OUTPUT/5420_Sunday_June_05_2022_03_36_48_PM_64201154/index.tex
]
Book: Differential Equations: Theory, Technique, and Practice by George Simmons, Steven
Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section: Chapter 1. What is a differential equation. Section 1.4 First Order Linear Equations.
Page 15
Problem number: 2(f).
ODE order: 1.
ODE degree: 1.
The type(s) of ODE detected by this program : "exact", "linear", "separable", "differentialType", "homogeneousTypeMapleC", "first_order_ode_lie_symmetry_lookup"
Maple gives the following as the ode type
[_separable]
\[ \boxed {x^{2} y^{\prime }+y x=2 x} \] With initial conditions \begin {align*} [y \left (1\right ) = 1] \end {align*}
This is a linear ODE. In canonical form it is written as \begin {align*} y^{\prime } + p(x)y &= q(x) \end {align*}
Where here \begin {align*} p(x) &=\frac {1}{x}\\ q(x) &=\frac {2}{x} \end {align*}
Hence the ode is \begin {align*} y^{\prime }+\frac {y}{x} = \frac {2}{x} \end {align*}
The domain of \(p(x)=\frac {1}{x}\) is \[
\{x <0\boldsymbol {\lor }0
Entering Linear first order ODE solver. The integrating factor \(\mu \) is \begin{align*}
\mu &= {\mathrm e}^{\int \frac {1}{x}d x} \\
&= x \\
\end{align*} The ode becomes
\begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (\frac {2}{x}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (x y\right ) &= \left (x\right ) \left (\frac {2}{x}\right )\\ \mathrm {d} \left (x y\right ) &= 2\, \mathrm {d} x \end {align*}
Integrating gives \begin {align*} x y &= \int {2\,\mathrm {d} x}\\ x y &= 2 x + c_{1} \end {align*}
Dividing both sides by the integrating factor \(\mu =x\) results in \begin {align*} y &= 2+\frac {c_{1}}{x} \end {align*}
Initial conditions are used to solve for \(c_{1}\). Substituting \(x=1\) and \(y=1\) in the above solution gives an
equation to solve for the constant of integration. \begin {align*} 1 = 2+c_{1} \end {align*}
The solutions are \begin {align*} c_{1} = -1 \end {align*}
Trying the constant \begin {align*} c_{1} = -1 \end {align*}
Substituting this in the general solution gives \begin {align*} y&=\frac {2 x -1}{x} \end {align*}
The constant \(c_{1} = -1\) gives valid solution.
Summary
The solution(s) found are the following \begin{align*}
\tag{1} y &= \frac {2 x -1}{x} \\
\end{align*} Verification of solutions
\[
y = \frac {2 x -1}{x}
\] Verified OK. \[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [x^{2} y^{\prime }+y x =2 x , y \left (1\right )=1\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & y^{\prime }=\frac {-y x +2 x}{x^{2}} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {y^{\prime }}{y-2}=-\frac {1}{x} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \frac {y^{\prime }}{y-2}d x =\int -\frac {1}{x}d x +c_{1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \ln \left (y-2\right )=-\ln \left (x \right )+c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {{\mathrm e}^{c_{1}}+2 x}{x} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (1\right )=1 \\ {} & {} & 1={\mathrm e}^{c_{1}}+2 \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} c_{1} \\ {} & {} & c_{1} =\mathrm {I} \pi \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} c_{1} =\mathrm {I} \pi \hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y=\frac {2 x -1}{x} \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y=\frac {2 x -1}{x} \end {array} \]
Maple trace
✓ Solution by Maple
Time used: 0.016 (sec). Leaf size: 13
\[
y \left (x \right ) = \frac {2 x -1}{x}
\]
✓ Solution by Mathematica
Time used: 0.039 (sec). Leaf size: 12
\[
y(x)\to 2-\frac {1}{x}
\]
3.16.2 Solving as linear ode
3.16.3 Maple step by step solution
`Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
<- 1st order linear successful`
dsolve([x^2*diff(y(x),x)+x*y(x)=2*x,y(1) = 1],y(x), singsol=all)
DSolve[{x^2*y'[x]+x*y[x]==2*x,{y[1]==1}},y[x],x,IncludeSingularSolutions -> True]