Message Boards Message Boards

0
|
2546 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

How to solve for f(x)=g(x)?

Hi, I am a calculus student using mathematica for project assignments. I have run into an issue where I need to solve |Sin x|=|x^2-4|. There are 4 solutions to this problem, but I cannot for the life of me program Mathematica to solve it. Any advice?

POSTED BY: Elanor Lambert
4 Replies

Thanks so much! I'll try that.

POSTED BY: Elanor Lambert
Posted 4 years ago

Try

Solve[Abs[Sin[x]]==Abs[x^2-4],x,Reals]

Mathematica will often assume variables and solutions may be complex numbers. Putting that Reals into Solve tells it to only look for solutions that are real. For this problem that seems to help it understand what to look for. There is also the issue of when to use [] versus () and when to use == versus =. And to use Abs[] instead of ||, which has a completely different meaning in Mathematica.

POSTED BY: Bill Nelson

Thanks, I did try that, but the formatting of the command seems to be the biggest issue for me.

POSTED BY: Elanor Lambert
Posted 4 years ago

Hint: f(x) == g(x) -> f(x) - g(x) == 0, then use Solve.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract