# how to get simplified result of solving equation

Hi there!

In a linear algebra assignment I have the following equation I need to find a solution for:

-2*sqrt(3)*sin(t)^2+2*cos(t)*sin(t)+sqrt(3)==0. I know the result is pi/3.

Now, when I use solve, solve(-2*sqrt(3)*sin(t)^2+2*cos(t)*sin(t)+sqrt(3)==0, t). I get:

[sin(t) == -1/6*sqrt(3)*(sqrt(cos(t)^2+6)-cos(t), sin(t) == 1/6*sqrt(3)*sqrt(cos(t)^2+6)+cos(t))].


How do I use the solve function to get the more simplified result?

NB: I have also tried to use find_root and different simplify functions, but also without any luck. I am new to sage, so it is quite possible that I don't know a specification to the solve function which I should use.

Thank you in advance!

Sincerly Simon

edit retag close merge delete

Sort by ยป oldest newest most voted

First, be sure to define your variable using var('t').

To find a numerical solution, you can plot the function to help identify where the roots are.

plot(-2*sqrt(3)*sin(t)^2+2*cos(t)*sin(t)+sqrt(3),(t,-10,10))


For example, to get the first positive root, you can now use find_root to find the root between 0 and 3.

find_root(-2*sqrt(3)*sin(t)^2+2*cos(t)*sin(t)+sqrt(3),-3,3)


which gives 2.6179938779914944.

For an analytic solution, you can do the following:

solve(-2*sqrt(3)*sin(x)^2+2*cos(x)*sin(x)+sqrt(3)==0, x,to_poly_solve ='force')


This gives: [x == 1/3*pi + pi*z1, x == -1/6*pi + pi*z2]

The z1 and z2 can be any integers.

(Interestingly, I could not get the solve to work with t as the variable. I'm not sure why.)

more

Thank you very much for your answer!

I have marked your answer as being the correct answer. I don't know if I am to give you points, but if I am, please reply of how I do this.

Sincerly Simon

( 2015-08-18 08:54:34 +0200 )edit

Thank you. The points are managed by the website automatically.

( 2015-08-19 00:21:23 +0200 )edit