2.4.7 Problem 7
Internal
problem
ID
[19729]
Book
:
Elementary
Differential
Equations.
By
Thornton
C.
Fry.
D
Van
Nostrand.
NY.
First
Edition
(1929)
Section
:
Chapter
IV.
Methods
of
solution:
First
order
equations.
section
31.
Problems
at
page
85
Problem
number
:
7
Date
solved
:
Friday, November 28, 2025 at 06:40:33 PM
CAS
classification
:
[_Bernoulli]
Solved using first_order_ode_bernoulli
Time used: 0.416 (sec)
Solve
\begin{align*}
y-\cos \left (x \right ) y^{\prime }&=y^{2} \cos \left (x \right ) \left (1-\sin \left (x \right )\right ) \\
\end{align*}
In canonical form, the ODE is
\begin{align*} y' &= F(x,y)\\ &= \frac {y \left (\cos \left (x \right ) \sin \left (x \right ) y -y \cos \left (x \right )+1\right )}{\cos \left (x \right )} \end{align*}
This is a Bernoulli ODE.
\[ y' = \left (\frac {1}{\cos \left (x \right )}\right ) y + \left (\frac {\sin \left (x \right ) \cos \left (x \right )-\cos \left (x \right )}{\cos \left (x \right )}\right )y^{2} \tag {1} \]
The standard Bernoulli ODE has the form
\[ y' = f_0(x)y+f_1(x)y^n \tag {2} \]
Comparing this to (1) shows
that
\begin{align*} f_0 &=\frac {1}{\cos \left (x \right )}\\ f_1 &=\frac {\sin \left (x \right ) \cos \left (x \right )-\cos \left (x \right )}{\cos \left (x \right )} \end{align*}
The first step is to divide the above equation by \(y^n \) which gives
\[ \frac {y'}{y^n} = f_0(x) y^{1-n} +f_1(x) \tag {3} \]
The next step is use the substitution
\(v = y^{1-n}\) in equation (3) which generates a new ODE in
\(v \left (x \right )\) which will be linear and can be easily solved
using an integrating factor. Backsubstitution then gives the solution
\(y(x)\) which is what we
want.
This method is now applied to the ODE at hand. Comparing the ODE (1) With (2) Shows that
\begin{align*} f_0(x)&=\frac {1}{\cos \left (x \right )}\\ f_1(x)&=\frac {\sin \left (x \right ) \cos \left (x \right )-\cos \left (x \right )}{\cos \left (x \right )}\\ n &=2 \end{align*}
Dividing both sides of ODE (1) by \(y^n=y^{2}\) gives
\begin{align*} y'\frac {1}{y^{2}} &= \frac {1}{\cos \left (x \right ) y} +\frac {\sin \left (x \right ) \cos \left (x \right )-\cos \left (x \right )}{\cos \left (x \right )} \tag {4} \end{align*}
Let
\begin{align*} v &= y^{1-n} \\ &= \frac {1}{y} \tag {5} \end{align*}
Taking derivative of equation (5) w.r.t \(x\) gives
\begin{align*} v' &= -\frac {1}{y^{2}}y' \tag {6} \end{align*}
Substituting equations (5) and (6) into equation (4) gives
\begin{align*} -v^{\prime }\left (x \right )&= \frac {v \left (x \right )}{\cos \left (x \right )}+\frac {\sin \left (x \right ) \cos \left (x \right )-\cos \left (x \right )}{\cos \left (x \right )}\\ v' &= -\frac {v}{\cos \left (x \right )}-\frac {\sin \left (x \right ) \cos \left (x \right )-\cos \left (x \right )}{\cos \left (x \right )} \tag {7} \end{align*}
The above now is a linear ODE in \(v \left (x \right )\) which is now solved.
In canonical form a linear first order is
\begin{align*} v^{\prime }\left (x \right ) + q(x)v \left (x \right ) &= p(x) \end{align*}
Comparing the above to the given ode shows that
\begin{align*} q(x) &=\sec \left (x \right )\\ p(x) &=1-\sin \left (x \right ) \end{align*}
The integrating factor \(\mu \) is
\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int \sec \left (x \right )d x}\\ &= \sec \left (x \right )+\tan \left (x \right ) \end{align*}
The ode becomes
\begin{align*}
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu v\right ) &= \mu p \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu v\right ) &= \left (\mu \right ) \left (1-\sin \left (x \right )\right ) \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (v \left (\sec \left (x \right )+\tan \left (x \right )\right )\right ) &= \left (\sec \left (x \right )+\tan \left (x \right )\right ) \left (1-\sin \left (x \right )\right ) \\
\mathrm {d} \left (v \left (\sec \left (x \right )+\tan \left (x \right )\right )\right ) &= \left (\left (1-\sin \left (x \right )\right ) \left (\sec \left (x \right )+\tan \left (x \right )\right )\right )\, \mathrm {d} x \\
\end{align*}
Integrating gives
\begin{align*} v \left (\sec \left (x \right )+\tan \left (x \right )\right )&= \int {\left (1-\sin \left (x \right )\right ) \left (\sec \left (x \right )+\tan \left (x \right )\right ) \,dx} \\ &=\sin \left (x \right ) + c_1 \end{align*}
Dividing throughout by the integrating factor \(\sec \left (x \right )+\tan \left (x \right )\) gives the final solution
\[ v \left (x \right ) = \frac {\left (\sin \left (x \right )+c_1 \right ) \left (\cos \left (x \right )-\sin \left (x \right )+1\right )}{\cos \left (x \right )+\sin \left (x \right )+1} \]
The substitution
\(v = y^{1-n}\) is
now used to convert the above solution back to
\(y\) which results in
\[
\frac {1}{y} = \frac {\left (\sin \left (x \right )+c_1 \right ) \left (\cos \left (x \right )-\sin \left (x \right )+1\right )}{\cos \left (x \right )+\sin \left (x \right )+1}
\]
Solving for
\(y\) gives
\begin{align*}
y &= \frac {\cos \left (x \right )+\sin \left (x \right )+1}{\sin \left (x \right ) \cos \left (x \right )+c_1 \cos \left (x \right )-\sin \left (x \right )^{2}-c_1 \sin \left (x \right )+\sin \left (x \right )+c_1} \\
\end{align*}
Figure 2.63: Slope field \(y-\cos \left (x \right ) y^{\prime } = y^{2} \cos \left (x \right ) \left (1-\sin \left (x \right )\right )\)
Summary of solutions found
\begin{align*}
y &= \frac {\cos \left (x \right )+\sin \left (x \right )+1}{\sin \left (x \right ) \cos \left (x \right )+c_1 \cos \left (x \right )-\sin \left (x \right )^{2}-c_1 \sin \left (x \right )+\sin \left (x \right )+c_1} \\
\end{align*}
✓ Maple. Time used: 0.002 (sec). Leaf size: 27
ode := y ( x )- cos ( x )* diff ( y ( x ), x ) = y(x)^2*cos(x)*(1-sin(x));
dsolve ( ode , y ( x ), singsol=all);
\[
y = \frac {\cos \left (x \right )+\sin \left (x \right )+1}{\left (\sin \left (x \right )+c_1 \right ) \left (-\sin \left (x \right )+\cos \left (x \right )+1\right )}
\]
Maple trace
Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
trying Bernoulli
<- Bernoulli successful
Maple step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & y \left (x \right )-\cos \left (x \right ) \left (\frac {d}{d x}y \left (x \right )\right )=y \left (x \right )^{2} \cos \left (x \right ) \left (1-\sin \left (x \right )\right ) \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=-\frac {-y \left (x \right )+y \left (x \right )^{2} \cos \left (x \right ) \left (1-\sin \left (x \right )\right )}{\cos \left (x \right )} \end {array} \]
✓ Mathematica. Time used: 0.28 (sec). Leaf size: 41
ode = y [ x ]- Cos [ x ]* D [ y [ x ], x ]== y [ x ]^2* Cos [ x ]*(1- Sin [ x ]);
ic ={};
DSolve [{ ode , ic }, y [ x ], x , IncludeSingularSolutions -> True ]
\begin{align*} y(x)&\to \frac {e^{2 \text {arctanh}\left (\tan \left (\frac {x}{2}\right )\right )}}{\cos (x) e^{2 \text {arctanh}\left (\tan \left (\frac {x}{2}\right )\right )}+c_1}\\ y(x)&\to 0 \end{align*}
✓ Sympy. Time used: 1.379 (sec). Leaf size: 39
from sympy import *
x = symbols("x")
y = Function("y")
ode = Eq((sin(x) - 1)*y(x)**2*cos(x) + y(x) - cos(x)*Derivative(y(x), x),0)
ics = {}
dsolve ( ode , func = y ( x ), ics = ics )
\[
y{\left (x \right )} = \frac {\sqrt {\sin {\left (x \right )} + 1}}{\left (C_{1} - \int \sqrt {\sin {\left (x \right )} - 1} \sqrt {\sin {\left (x \right )} + 1}\, dx\right ) \sqrt {\sin {\left (x \right )} - 1}}
\]