Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Solving trigonometric equations in interval.

Hi I have a question. I am trying to find the values between a given inteval for a trigonometric equation ex.

sin(x) == 0.8, (0>x>2*pi)

If I solve the function like this

f = sin(x)
solve(f,x)

Then i only recieve the result for the first time f == 0.8. I found out that there are ways to get all the values for f== 0.8 if i type some command like

solve(f,x,to_poly_solve=True)

or

y = var('y')
solve([sin(x)==y,y==0.8],[x,y])

or

 solve(sin(x)==0.8, x, to_poly_solve = 'force')

But all these methods give me only some crazy outputs which i don't understand - and far out of the interval than i want.

I found out that I can move the function down and find the roots if i type

first = find_roots(0.8-f,0,1)
second = find_roots(0.8-f,0,2*pi)

And then i will get the result for the value of x when f == 0.8

But it seems like a pretty big work around just to get this result, and when i am working with bigger equations, then i will have to plot them first to find out which xmin and xmax values i should put in the "find_root" feature.

Are there an easier way to get the results or a tutorial or something how to make it simpler? Maybe i can define my own command somehow?

Thank you in advance.