TransWikia.com

Mathematica outputs a trigonometric integral ($sec^3$) in a form I can't prove

Mathematica Asked by Emanuel Landeholm on June 26, 2021

The indefinite integral is of course $1/2 ( sec(x) tan(x) + ln | sec(x) + tan(x) | ( + C)$.

Mathematica gives:

Integrate[Sec[x]^3, x]

1/2 (-Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]] + Sec[x] Tan[x])

The $1/2 sec(x) tan(x)$ is there, but I’ve spent a couple of hours trying to prove that Mathematica’s logarithm really is $ln | sec(x) + tan(x) |$, and I just can’t do it! The $x/2$ half-angles throw a spanner into the works for me. They just seem so wrong to me, it’s like the half-angle formula backwards. I get square roots where I’d like to see squares.

I’m sure I’m missing something obvious, but I just can’t see it!

One Answer

Differentiate, combine the logarithms, and work backwards using the half angle formulae and the identity $1+tan(x)^2 = sec(x)^2$

FullSimplify[
 D[1/2 (-Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]] + Sec[x] Tan[x]), x]
]
(* result: Sec[x]^3 *)

You can get there yourself if you first show:

FullSimplify[-(-(1/2) Cos[x/2] - 1/2 Sin[x/2])/(
  Cos[x/2] - Sin[x/2]) + (1/2 Cos[x/2] - 1/2 Sin[x/2])/(
  Cos[x/2] + Sin[x/2])]

(* Sec[x] *)

To get the above result, take a look at what happens when you put it all over a common denominator:

Together[-((-(1/2) Cos[x/2] - 1/2 Sin[x/2])/(Cos[x/2] - Sin[x/2])) + (
  1/2 Cos[x/2] - 1/2 Sin[x/2])/(Cos[x/2] + Sin[x/2])]

(* (Cos[x/2]^2 + Sin[x/2]^2)/
 ((Cos[x/2] - Sin[x/2]) (Cos[x/2] + Sin[x/2])) *)

The numerator is obviously 1 by the identity $cos(theta)^2+sin(theta)^2=1$ and the denominator is $cos(x)$ by half angles. To see this, expand the denominator $d=left(cos left(frac{x}{2}right)-sin left(frac{x}{2}right)right) left(sin left(frac{x}{2}right)+cos left(frac{x}{2}right)right)$ to get $d=cos ^2left(frac{x}{2}right)-sin ^2left(frac{x}{2}right)$. Then we have $d = 1-2 sin ^2left(frac{x}{2}right) = cos(x)$ and $1/d$ is $sec(x)$

... and as for the rest of the derivative:

FullSimplify[1 - Sec[x]^2]
(* Tan[x]^2 *)

So therefore:

D[1/2 (-Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]] + Sec[x] Tan[x]), x]

(* 1/2 (Sec[x]^3 - (-(1/2) Cos[x/2] - 1/2 Sin[x/2])/(
   Cos[x/2] - Sin[x/2]) + (1/2 Cos[x/2] - 1/2 Sin[x/2])/(
   Cos[x/2] + Sin[x/2]) + Sec[x] Tan[x]^2) *)

(* == (Sec[x]^3 + Sec[x] (1 + Tan[x]^2))/2 *)
(* == (Sec[x]^3 + Sec[x]^3)/2 == Sec[x]^3 *)

Correct answer by flinty on June 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP