2.10.7 Problem 22
Internal
problem
ID
[13384]
Book
:
Handbook
of
exact
solutions
for
ordinary
differential
equations.
By
Polyanin
and
Zaitsev.
Second
edition
Section
:
Chapter
1,
section
1.2.
Riccati
Equation.
subsection
1.2.6-2.
Equations
with
cosine.
Problem
number
:
22
Date
solved
:
Wednesday, December 31, 2025 at 02:14:27 PM
CAS
classification
:
[_Riccati]
2.10.7.1 Solved using first_order_ode_riccati
14.317 (sec)
Entering first order ode riccati solver
\begin{align*}
y^{\prime }&=-\left (k +1\right ) x^{k} y^{2}+a \,x^{k +1} \cos \left (x \right )^{m} y-a \cos \left (x \right )^{m} \\
\end{align*}
In canonical form the ODE is \begin{align*} y' &= F(x,y)\\ &= -x^{k} y^{2} k +a \,x^{k +1} \cos \left (x \right )^{m} y-x^{k} y^{2}-a \cos \left (x \right )^{m} \end{align*}
This is a Riccati ODE. Comparing the ODE to solve
\[
y' = \textit {the\_rhs}
\]
With Riccati ODE standard form \[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows
that \(f_0(x)=-a \cos \left (x \right )^{m}\), \(f_1(x)=a x \,x^{k} \cos \left (x \right )^{m}\) and \(f_2(x)=-x^{k} k -x^{k}\). Let \begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{u \left (-x^{k} k -x^{k}\right )} \tag {1} \end{align*}
Using the above substitution in the given ODE results (after some simplification) in a second
order ODE to solve for \(u(x)\) which is
\begin{align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end{align*}
But
\begin{align*} f_2' &=-\frac {x^{k} k^{2}}{x}-\frac {x^{k} k}{x}\\ f_1 f_2 &=a x \,x^{k} \cos \left (x \right )^{m} \left (-x^{k} k -x^{k}\right )\\ f_2^2 f_0 &=-\left (-x^{k} k -x^{k}\right )^{2} a \cos \left (x \right )^{m} \end{align*}
Substituting the above terms back in equation (2) gives
\[
\left (-x^{k} k -x^{k}\right ) u^{\prime \prime }\left (x \right )-\left (-\frac {x^{k} k^{2}}{x}-\frac {x^{k} k}{x}+a x \,x^{k} \cos \left (x \right )^{m} \left (-x^{k} k -x^{k}\right )\right ) u^{\prime }\left (x \right )-\left (-x^{k} k -x^{k}\right )^{2} a \cos \left (x \right )^{m} u \left (x \right ) = 0
\]
Entering second order change of variable
on \(y\) method 2 solverIn normal form the ode \begin{align*} \left (-x^{k} k -x^{k}\right ) \left (\frac {d^{2}u}{d x^{2}}\right )-\left (-\frac {x^{k} k^{2}}{x}-\frac {x^{k} k}{x}+a x \,x^{k} \cos \left (x \right )^{m} \left (-x^{k} k -x^{k}\right )\right ) \left (\frac {d u}{d x}\right )-\left (-x^{k} k -x^{k}\right )^{2} a \cos \left (x \right )^{m} u = 0\tag {1} \end{align*}
Becomes
\begin{align*} \frac {d^{2}u}{d x^{2}}+p \left (x \right ) \left (\frac {d u}{d x}\right )+q \left (x \right ) u&=0 \tag {2} \end{align*}
Where
\begin{align*} p \left (x \right )&=-x^{k +1} \cos \left (x \right )^{m} a -\frac {k}{x}\\ q \left (x \right )&=a \,x^{k} \left (k +1\right ) \cos \left (x \right )^{m} \end{align*}
Applying change of variables on the depndent variable \(u = v \left (x \right ) x^{n}\) to (2) gives the following ode where the
dependent variables is \(v \left (x \right )\) and not \(u\).
\begin{align*} \frac {d^{2}}{d x^{2}}v \left (x \right )+\left (\frac {2 n}{x}+p \right ) \left (\frac {d}{d x}v \left (x \right )\right )+\left (\frac {n \left (n -1\right )}{x^{2}}+\frac {n p}{x}+q \right ) v \left (x \right )&=0 \tag {3} \end{align*}
Let the coefficient of \(v \left (x \right )\) above be zero. Hence
\begin{align*} \frac {n \left (n -1\right )}{x^{2}}+\frac {n p}{x}+q&=0 \tag {4} \end{align*}
Substituting the earlier values found for \(p \left (x \right )\) and \(q \left (x \right )\) into (4) gives
\begin{align*} \frac {n \left (n -1\right )}{x^{2}}+\frac {n \left (-x^{k +1} \cos \left (x \right )^{m} a -\frac {k}{x}\right )}{x}+a \,x^{k} \left (k +1\right ) \cos \left (x \right )^{m}&=0 \tag {5} \end{align*}
Solving (5) for \(n\) gives
\begin{align*} n&=k +1 \tag {6} \end{align*}
Substituting this value in (3) gives
\begin{align*} \frac {d^{2}}{d x^{2}}v \left (x \right )+\left (\frac {2 k +2}{x}-x^{k +1} \cos \left (x \right )^{m} a -\frac {k}{x}\right ) \left (\frac {d}{d x}v \left (x \right )\right )&=0 \\ \frac {d^{2}}{d x^{2}}v \left (x \right )+\frac {\left (-a \,x^{k +2} \cos \left (x \right )^{m}+k +2\right ) \left (\frac {d}{d x}v \left (x \right )\right )}{x}&=0 \tag {7} \\ \end{align*}
Using the substitution
\begin{align*} u \left (x \right ) = \frac {d}{d x}v \left (x \right ) \end{align*}
Then (7) becomes
\begin{align*} \frac {d}{d x}u \left (x \right )+\frac {\left (-a \,x^{k +2} \cos \left (x \right )^{m}+k +2\right ) u \left (x \right )}{x} = 0 \tag {8} \\ \end{align*}
The above is now solved for \(u \left (x \right )\). Entering first order ode linear solverIn canonical form a linear first
order is
\begin{align*} \frac {d}{d x}u \left (x \right ) + q(x)u \left (x \right ) &= p(x) \end{align*}
Comparing the above to the given ode shows that
\begin{align*} q(x) &=-\frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}\\ p(x) &=0 \end{align*}
The integrating factor \(\mu \) is
\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x}\\ &= {\mathrm e}^{\int -\frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} \end{align*}
The ode becomes
\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \mu u &= 0 \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (u \,{\mathrm e}^{\int -\frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x}\right ) &= 0 \end{align*}
Integrating gives
\begin{align*} u \,{\mathrm e}^{\int -\frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x}&= \int {0 \,dx} + c_1 \\ &=c_1 \end{align*}
Dividing throughout by the integrating factor \({\mathrm e}^{\int -\frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x}\) gives the final solution
\[ u \left (x \right ) = {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} c_1 \]
Now that \(u \left (x \right )\) is known, then
\begin{align*} \frac {d}{d x}v \left (x \right )&= u \left (x \right )\\ v \left (x \right )&= \int u \left (x \right )d x +c_2\\ &= \int {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} c_1 d x +c_2 \end{align*}
Hence
\begin{align*} u&= v \left (x \right ) x^{n}\\ &= \left (\int {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} c_1 d x +c_2 \right ) x^{k +1}\\ &= x^{k +1} \left (c_1 \int {\mathrm e}^{\int \frac {x^{k +1} \cos \left (x \right )^{m} a x -k -2}{x}d x}d x +c_2 \right )\\ \end{align*}
Taking derivative gives
\begin{equation}
\tag{4} u^{\prime }\left (x \right ) = {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} c_1 \,x^{k +1}+\frac {\left (\int {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} c_1 d x +c_2 \right ) x^{k +1} \left (k +1\right )}{x}
\end{equation}
Substituting equations (3,4) into (1) results in \begin{align*}
y &= \frac {-u'}{f_2 u} \\
y &= \frac {-u'}{u \left (-x^{k} k -x^{k}\right )} \\
y &= -\frac {\left ({\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} c_1 \,x^{k +1}+\frac {\left (\int {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} c_1 d x +c_2 \right ) x^{k +1} \left (k +1\right )}{x}\right ) x^{-k -1}}{\left (-x^{k} k -x^{k}\right ) \left (\int {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} c_1 d x +c_2 \right )} \\
\end{align*}
Doing change of
constants, the above solution becomes \[
y = -\frac {\left ({\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} x^{k +1}+\frac {\left (\int {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x}d x +c_3 \right ) x^{k +1} \left (k +1\right )}{x}\right ) x^{-k -1}}{\left (-x^{k} k -x^{k}\right ) \left (\int {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x}d x +c_3 \right )}
\]
Summary of solutions found
\begin{align*}
y &= -\frac {\left ({\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x} x^{k +1}+\frac {\left (\int {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x}d x +c_3 \right ) x^{k +1} \left (k +1\right )}{x}\right ) x^{-k -1}}{\left (-x^{k} k -x^{k}\right ) \left (\int {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-k -2}{x}d x}d x +c_3 \right )} \\
\end{align*}
2.10.7.2 Solved using first_order_ode_riccati_by_guessing_particular_solution
16.080 (sec)
Entering first order ode riccati guess solver
\begin{align*}
y^{\prime }&=-\left (k +1\right ) x^{k} y^{2}+a \,x^{k +1} \cos \left (x \right )^{m} y-a \cos \left (x \right )^{m} \\
\end{align*}
This is a Riccati ODE. Comparing the above ODE to
solve with the Riccati standard form \[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows that \begin{align*} f_0(x) & =-a \cos \left (x \right )^{m}\\ f_1(x) & =a x \,x^{k} \cos \left (x \right )^{m}\\ f_2(x) &=-x^{k} k -x^{k} \end{align*}
Using trial and error, the following particular solution was found
\[
y_p = x^{-k -1}
\]
Since a particular solution is
known, then the general solution is given by \begin{align*} y &= y_p + \frac { \phi (x) }{ c_1 - \int { \phi (x) f_2 \,dx} } \end{align*}
Where
\begin{align*} \phi (x) &= e^{ \int 2 f_2 y_p + f_1 \,dx } \end{align*}
Evaluating the above gives the general solution as
\[
y = x^{-k -1}+\frac {{\mathrm e}^{\int \left (2 x^{-k -1} \left (-x^{k} k -x^{k}\right )+a x \,x^{k} \cos \left (x \right )^{m}\right )d x}}{c_1 -\int {\mathrm e}^{\int \left (2 x^{-k -1} \left (-x^{k} k -x^{k}\right )+a x \,x^{k} \cos \left (x \right )^{m}\right )d x} \left (-x^{k} k -x^{k}\right )d x}
\]
Summary of solutions found
\begin{align*}
y &= x^{-k -1}+\frac {{\mathrm e}^{\int \left (2 x^{-k -1} \left (-x^{k} k -x^{k}\right )+a x \,x^{k} \cos \left (x \right )^{m}\right )d x}}{c_1 -\int {\mathrm e}^{\int \left (2 x^{-k -1} \left (-x^{k} k -x^{k}\right )+a x \,x^{k} \cos \left (x \right )^{m}\right )d x} \left (-x^{k} k -x^{k}\right )d x} \\
\end{align*}
2.10.7.3 ✓ Maple. Time used: 0.018 (sec). Leaf size: 170
ode:=diff(y(x),x) = -(1+k)*x^k*y(x)^2+a*x^(1+k)*cos(x)^m*y(x)-a*cos(x)^m;
dsolve(ode,y(x), singsol=all);
\[
y = \frac {x^{-k -1} \left (x^{k +1} {\mathrm e}^{\int \frac {x^{k +1} \cos \left (x \right )^{m} a x -2 k -2}{x}d x}+\int x^{k} {\mathrm e}^{\int \frac {x^{k +1} \cos \left (x \right )^{m} a x -2 k -2}{x}d x}d x k +\int x^{k} {\mathrm e}^{\int \frac {x^{k +1} \cos \left (x \right )^{m} a x -2 k -2}{x}d x}d x +c_1 \right )}{\int x^{k} {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-2 k -2}{x}d x}d x k +c_1 +\int x^{k} {\mathrm e}^{\int \frac {a \,x^{k +2} \cos \left (x \right )^{m}-2 k -2}{x}d x}d x}
\]
Maple trace
Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
trying inverse linear
trying homogeneous types:
trying Chini
differential order: 1; looking for linear symmetries
trying exact
Looking for potential symmetries
trying Riccati
trying Riccati sub-methods:
trying Riccati_symmetries
trying Riccati to 2nd Order
-> Calling odsolve with the ODE, diff(diff(y(x),x),x) = (x^(k+1)*cos(x)^m*a*
x+k)/x*diff(y(x),x)-x^k*(k+1)*a*cos(x)^m*y(x), y(x)
*** Sublevel 2 ***
Methods for second order ODEs:
--- Trying classification methods ---
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Heun: Equivalence to the GHE or one of its 4 confluent cases under a \
power @ Moebius
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(int\
(r(x), dx)) * 2F1([a1, a2], [b1], f)
-> Trying changes of variables to rationalize or make the ODE simpler
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Heun: Equivalence to the GHE or one of its 4 confluent cases under \
a power @ Moebius
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(\
int(r(x), dx)) * 2F1([a1, a2], [b1], f)
trying a symmetry of the form [xi=0, eta=F(x)]
trying 2nd order exact linear
trying symmetries linear in x and y(x)
trying to convert to a linear ODE with constant coefficients
-> trying with_periodic_functions in the coefficients
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Heun: Equivalence to the GHE or one of its 4 confluent cases under \
a power @ Moebius
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(\
int(r(x), dx)) * 2F1([a1, a2], [b1], f)
trying a symmetry of the form [xi=0, eta=F(x)]
trying 2nd order exact linear
trying symmetries linear in x and y(x)
trying to convert to a linear ODE with constant coefficients
<- unable to find a useful change of variables
trying a symmetry of the form [xi=0, eta=F(x)]
trying 2nd order exact linear
trying symmetries linear in x and y(x)
trying to convert to a linear ODE with constant coefficients
trying 2nd order, integrating factor of the form mu(x,y)
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Heun: Equivalence to the GHE or one of its 4 confluent cases under \
a power @ Moebius
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(\
int(r(x), dx)) * 2F1([a1, a2], [b1], f)
-> Trying changes of variables to rationalize or make the ODE simpler
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Heun: Equivalence to the GHE or one of its 4 confluent cases und\
er a power @ Moebius
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = e\
xp(int(r(x), dx)) * 2F1([a1, a2], [b1], f)
trying a symmetry of the form [xi=0, eta=F(x)]
trying 2nd order exact linear
trying symmetries linear in x and y(x)
trying to convert to a linear ODE with constant coefficients
-> trying with_periodic_functions in the coefficients
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Heun: Equivalence to the GHE or one of its 4 confluent cases und\
er a power @ Moebius
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = e\
xp(int(r(x), dx)) * 2F1([a1, a2], [b1], f)
trying a symmetry of the form [xi=0, eta=F(x)]
trying 2nd order exact linear
trying symmetries linear in x and y(x)
trying to convert to a linear ODE with constant coefficients
-> trying with_periodic_functions in the coefficients
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Heun: Equivalence to the GHE or one of its 4 confluent cases und\
er a power @ Moebius
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = e\
xp(int(r(x), dx)) * 2F1([a1, a2], [b1], f)
trying a symmetry of the form [xi=0, eta=F(x)]
trying 2nd order exact linear
trying symmetries linear in x and y(x)
trying to convert to a linear ODE with constant coefficients
<- unable to find a useful change of variables
trying a symmetry of the form [xi=0, eta=F(x)]
trying to convert to an ODE of Bessel type
-> trying with_periodic_functions in the coefficients
-> Trying a change of variables to reduce to Bernoulli
-> Calling odsolve with the ODE, diff(y(x),x)-((-x^k*k-x^k)*y(x)^2+y(x)+a*x^
(k+1)*cos(x)^m*y(x)*x-x^2*a*cos(x)^m)/x, y(x), explicit
*** Sublevel 2 ***
Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
trying inverse linear
trying homogeneous types:
trying Chini
differential order: 1; looking for linear symmetries
trying exact
Looking for potential symmetries
trying Riccati
trying Riccati sub-methods:
trying Riccati_symmetries
trying inverse_Riccati
trying 1st order ODE linearizable_by_differentiation
-> trying a symmetry pattern of the form [F(x)*G(y), 0]
-> trying a symmetry pattern of the form [0, F(x)*G(y)]
-> trying a symmetry pattern of the form [F(x),G(x)*y+H(x)]
trying inverse_Riccati
trying 1st order ODE linearizable_by_differentiation
--- Trying Lie symmetry methods, 1st order ---
-> Computing symmetries using: way = 4
-> Computing symmetries using: way = 2
-> Computing symmetries using: way = 6
[0, exp(-Int((a*x^(k+2)*cos(x)^m-2*k-2)/x,x))*(y-1/(x^k)/x)^2]
<- successful computation of symmetries.
1st order, trying the canonical coordinates of the invariance group
<- 1st order, canonical coordinates successful
Maple step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=-\left (k +1\right ) x^{k} y \left (x \right )^{2}+a \,x^{k +1} \cos \left (x \right )^{m} y \left (x \right )-a \cos \left (x \right )^{m} \\ \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 )=-\left (k +1\right ) x^{k} y \left (x \right )^{2}+a \,x^{k +1} \cos \left (x \right )^{m} y \left (x \right )-a \cos \left (x \right )^{m} \end {array} \]
2.10.7.4 ✓ Mathematica. Time used: 2.329 (sec). Leaf size: 248
ode=D[y[x],x]==-(k+1)*x^k*y[x]^2+a*x^(k+1)*Cos[x]^m*y[x]-a*Cos[x]^m;
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to \frac {x^{-k-1} \left (c_1 x \exp \left (\int _1^x-\frac {-a \cos ^m(K[1]) K[1]^{k+2}+k+2}{K[1]}dK[1]\right )+c_1 (k+1) \int _1^x\exp \left (\int _1^{K[2]}-\frac {-a \cos ^m(K[1]) K[1]^{k+2}+k+2}{K[1]}dK[1]\right )dK[2]+k+1\right )}{(k+1) \left (1+c_1 \int _1^x\exp \left (\int _1^{K[2]}-\frac {-a \cos ^m(K[1]) K[1]^{k+2}+k+2}{K[1]}dK[1]\right )dK[2]\right )}\\ y(x)&\to \frac {x^{-k} \left (\frac {\exp \left (\int _1^x-\frac {-a \cos ^m(K[1]) K[1]^{k+2}+k+2}{K[1]}dK[1]\right )}{\int _1^x\exp \left (\int _1^{K[2]}-\frac {-a \cos ^m(K[1]) K[1]^{k+2}+k+2}{K[1]}dK[1]\right )dK[2]}+\frac {k+1}{x}\right )}{k+1} \end{align*}
2.10.7.5 ✗ Sympy
from sympy import *
x = symbols("x")
a = symbols("a")
k = symbols("k")
m = symbols("m")
y = Function("y")
ode = Eq(-a*x**(k + 1)*y(x)*cos(x)**m + a*cos(x)**m + x**k*(k + 1)*y(x)**2 + Derivative(y(x), x),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
Timed Out