63.5.17 problem 3(e)

Internal problem ID [13012]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 1, First order differential equations. Section 1.4.1. Integrating factors. Exercises page 41
Problem number : 3(e)
Date solved : Wednesday, March 05, 2025 at 08:57:19 PM
CAS classification : [_separable]

\begin{align*} \cos \left (\theta \right ) v^{\prime }+v&=3 \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 32
ode:=cos(theta)*diff(v(theta),theta)+v(theta) = 3; 
dsolve(ode,v(theta), singsol=all);
 
\[ v = \frac {\left (c_{1} +6\right ) \cos \left (\frac {\theta }{2}\right )-c_{1} \sin \left (\frac {\theta }{2}\right )}{\cos \left (\frac {\theta }{2}\right )+\sin \left (\frac {\theta }{2}\right )} \]
Mathematica. Time used: 0.087 (sec). Leaf size: 26
ode=Cos[theta]*D[v[theta],theta]+v[theta]==3; 
ic={}; 
DSolve[{ode,ic},v[theta],theta,IncludeSingularSolutions->True]
 
\begin{align*} v(\theta )\to 3+c_1 e^{-2 \text {arctanh}\left (\tan \left (\frac {\theta }{2}\right )\right )} \\ v(\theta )\to 3 \\ \end{align*}
Sympy. Time used: 0.395 (sec). Leaf size: 22
from sympy import * 
theta = symbols("theta") 
v = Function("v") 
ode = Eq(v(theta) + cos(theta)*Derivative(v(theta), theta) - 3,0) 
ics = {} 
dsolve(ode,func=v(theta),ics=ics)
 
\[ v{\left (\theta \right )} = \frac {C_{1} \sqrt {\sin {\left (\theta \right )} - 1}}{\sqrt {\sin {\left (\theta \right )} + 1}} + 3 \]