Is Wolfram Alpha wrong? (trig identity)

134 Views Asked by At

I have the following identity

$$ \sqrt{\cos(2x)\sec^4(x)}$$

I use the property $ \sqrt{a} \sqrt{b} = \sqrt{ab} $

which then yields

$$ \sqrt{\cos(2x)} \, \sec^2(x) $$

However, Wolfram tells me these 2 identities are not always equal.

Am i in the wrong here? Thanks for your help.

Apologies for the elementary question.

2

There are 2 best solutions below

0
On

With complex numbers one may need be careful with square roots and the identity you are using. For example $$\sqrt{(-1)}\sqrt{(-1)} = i^2=-1$$ but $$\sqrt{(-1) \cdot (-1)} = 1$$

Several times when using wolfram alpha I have noticed I need to tell it specifically what variables are real or it will be extra careful.

0
On

Wolfram uses the convention that $\sqrt{z} = \sqrt{|z|}\exp\left(\frac{i}{2}\mathrm{Arg}[z]\right)$, where $-\pi < \mathrm{Arg[z]}\le\pi$. With this convention, $\sqrt{ab} = \sqrt{a}\sqrt{b}$ only holds if $-\pi < \mathrm{Arg}[a] + \mathrm{Arg}[b] \le \pi$. Wolfram will not make any assumptions unless you tell it to, and the ranges of both $\cos$ and $\mathrm{sec}$ over $\mathbb C$ cover all of $\mathbb C \backslash \{0\}$. So it has no guarantee that the argument restriction for the identity is satisfied, and thus won't apply it.

However, if you restrict $x$ to be real, $\mathrm{Arg}[\sec(x)^4] = 0$ for all $x\in\mathbb R$. The argument condition for the identity will necessarily be satisfied, and under this condition it is true that $$ \sqrt{\cos(2x)\mathrm{sec}(x)^4} = \sqrt{\cos(2x)}\mathrm{sec}(x)^2 $$ using Wolfram's conventions for $\sqrt{z}$.

There's actually another complication here in that Wolfram considers the expression undefined when $\cos(x) = 0$, and thus will still refuse to claim they're equal on any interval that contains such a value. But it will claim the identity is valid on the intervals $\left(-\pi/2,\pi/2\right)$ and $\left(\pi/2,3\pi/2\right)$, and periodicity covers the rest.