4.1.26 \(y'(x)+\tan (x)=(1-y(x)) \sec (x)\)

ODE
\[ y'(x)+\tan (x)=(1-y(x)) \sec (x) \] ODE Classification

[_linear]

Book solution method
Linear ODE

Mathematica
cpu = 0.0450482 (sec), leaf count = 21

\[\left \{\left \{y(x)\to \left (c_1+x\right ) e^{-2 \tanh ^{-1}\left (\tan \left (\frac {x}{2}\right )\right )}\right \}\right \}\]

Maple
cpu = 0.01 (sec), leaf count = 15

\[ \left \{ y \left ( x \right ) ={\frac {x+{\it \_C1}}{\sec \left ( x \right ) +\tan \left ( x \right ) }} \right \} \] Mathematica raw input

DSolve[Tan[x] + y'[x] == Sec[x]*(1 - y[x]),y[x],x]

Mathematica raw output

{{y[x] -> (x + C[1])/E^(2*ArcTanh[Tan[x/2]])}}

Maple raw input

dsolve(diff(y(x),x)+tan(x) = (1-y(x))*sec(x), y(x),'implicit')

Maple raw output

y(x) = (x+_C1)/(sec(x)+tan(x))