I am getting Sqrt[Sin[a]^2] as the output to a calculation and I want it to be displayed as Sin[a].
Asked
Active
Viewed 183 times
1
Leo
- 45
- 1
- 6
1 Answers
4
Well, proper syntax would help. Then note that
Sqrt[Sin[a]^2] /. a -> -I
(* I Sinh[1] *)
but
Sin[a] /. a -> -I
(* -I Sinh[1] *)
John Doty
- 13,712
- 1
- 22
- 42
-
-
1
-
-
-
I was able to get the desired form by restricting a to the reals. Simplify[Sqrt[(Sin[a])^2], -Infinity < a < Infinity] gives |Sin[a]|. – Leo Jul 19 '17 at 12:05
Sqrt[sin^2(a)]is not proper syntax. (2)Sqrt[u^2]does not equalu, even for the real numbers, much less for complex numbers, which is the domain Mathematica works over. You could trySimplify[Sqrt[(sin (a))^2], sin (a) > 0], which yieldsa sin, an equivalent form ofsin(a), according to Mathematica syntax. Probably you wantSimplify[Sqrt[Sin[a]^2], Sin[a] > 0]and to learn the syntax of Mathematica. – Michael E2 Jul 18 '17 at 20:58PowerExpandto do this simplification, but you should be sure that this is the right thing to do (see @JohnDoty's answer). – JEM_Mosig Jul 19 '17 at 01:54