Message Boards Message Boards


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

Posted 1 month ago
4 Replies
1 Total Likes

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?

4 Replies
Posted 1 month ago

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

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

Posted 1 month ago



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.

Thanks so much! I'll try that.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract