Ask Your Question

Trigonometric equations [closed]

asked 2023-05-21 14:21:25 +0200

Sotto gravatar image

Hello Is it possible to find all the solutions of a simple trigonometric equation? For instance even sin(x) == 0 gives only x = 0 as a solution instead of k pi. Thanks, Nicola

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Sotto
close date 2023-05-22 17:20:56.145261


Welcome to Ask Sage! Thank you for your question!

slelievre gravatar imageslelievre ( 2023-05-21 15:02:26 +0200 )edit

Note that Ask Sage provides a search box.

Typing "trigonometric" in that box reveals a few previous questions, including

slelievre gravatar imageslelievre ( 2023-05-21 15:03:48 +0200 )edit

Hi @Sotto, to accept an answer, click the "accept" button at the top left of the answer.

It's the button with a checkmark (✓) below the answer's score and upvote/downvote buttons.

This marks the question as answered in the list of questions.

slelievre gravatar imageslelievre ( 2023-05-25 08:57:44 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2023-05-21 15:00:59 +0200

slelievre gravatar image

Use solve? to access the documentation of the solve function.

This reveals a lot of examples, including trigonometric equations.

There are basically two ways to get "all solutions" for such equations:

  • use algorithm='sympy'
  • use to_poly_solve='force'

If you use the to_poly_solve='force' option, you get something like:

sage: solve([eq], [x], to_poly_solve='force')
[x == pi*z1]

which means pi times any integer (indicated by z1, standing for an indexed integer variable $z_1$).

You can get a different index $k$ for the $z_k$ integer variable each time you solve.

If you use the algorithm='sympy' option, you get something like:

sage: solve([eq], [x], algorithm='sympy')
[ImageSet(Lambda(_n, 2*_n*pi), Integers),
 ImageSet(Lambda(_n, 2*_n*pi + pi), Integers)]
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2023-05-21 14:21:25 +0200

Seen: 123 times

Last updated: May 21 '23