2
$\begingroup$

FunctionExpand[Sin[3 Degree]] outputs exact radical result, while FunctionExpand[Sin[1 Degree]] does not.

How can I write a test function that will take as argument this output result and return true if it's a radical expression and false if it's not?

Map[{i, f} , Table[ FunctionExpand[Sin[i Degree]] ,{i,0,90}]]

returns {{1, False}, ...,{3, True}..}

$\endgroup$
  • $\begingroup$ f = FreeQ[Sin] should do for you. $\endgroup$ – Simon Rochester Dec 4 '16 at 5:44
  • $\begingroup$ Only multiples of 3 Degree give a numerical result. $\endgroup$ – corey979 Dec 4 '16 at 10:19
  • $\begingroup$ Do you want to test if Mathematica expands it in terms of radicals or whether it is at all possible to expand it in terms of radicals? It appears that Sin[Pi p/q] can always be written in terms of radials for any rational p/q (I didn't know this before today, hence my long and now deleted answer about trying to figure out what p/q allows such expansion). $\endgroup$ – Szabolcs Dec 4 '16 at 12:21
  • $\begingroup$ Here's some more on how you might solve in terms of radicals: maplesoft.com/applications/view.aspx?SID=7067&view=html $\endgroup$ – Szabolcs Dec 5 '16 at 20:03
  • 1
    $\begingroup$ A related question. Try this: ToRadicals[RootReduce[FunctionExpand[Sin[1 °]]]] $\endgroup$ – J. M.'s technical difficulties Dec 13 '16 at 15:42
2
$\begingroup$

It is not clear how you want integer and rational values handled.

test1 = FreeQ[#, _Sin | _Cos] &;

test2 = ! FreeQ[#, _Power] &;

(test1Result = 
   Select[{# Degree, FullSimplify[FunctionExpand[Sin[# Degree]]]} & /@ 
     Range[0, 90], test1]) // Length

(*  31  *)

(test2Result = 
   Select[{# Degree, FullSimplify[FunctionExpand[Sin[# Degree]]]} & /@ 
     Range[0, 90], test2]) // Length

(*  28  *)

Complement[test1Result, test2Result]

(*  {{0, 0}, {30 °, 1/2}, {90 °, 1}}  *)
| improve this answer | |
$\endgroup$
2
$\begingroup$

More like a comment.

Mathematica gives a numerical result, in form of a radical, for multiples of 3 Degree, which looks like this:

Partition[#, 2] &@
  Table[{i Degree, FunctionExpand[Sin[i Degree]]}, {i, 3, 90, 3}] // 
 TableForm[#, TableDepth -> 2] &

enter image description here

Others remain unevaluated.

Let's denote

sin3 = FunctionExpand[Sin[3 Degree]]

Then one can use the identity

$$\sin(3 x)=3\sin x-4 \sin^3 x$$

to solve for $\sin x$ = sin1:

sin1 = s1 /. Solve[sin3 == 3 s1 - 4 s1^3, s1][[2]] // Simplify

enter image description here

Despite

sin1 // N // Chop

0.0174524

and

Sin[1. Degree]

0.0174524

agree, we see that there are imaginary units in sin1; I guess this is a case of casus irreducibilis.

One can formally obtain sin2 via

$$\sin(2 x)=2\sin x\cos x=2\sin x\sqrt{1-\sin^2 x}$$

sin2 = 2 sin1 Sqrt[1 - sin1^2] // Simplify

enter image description here

See also this answer to another question for how to remove the imaginary unit I from sin1 and sin2.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.