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

Posted 1 month ago
406 Views
|
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? Answer
4 Replies
Sort By:
Posted 1 month ago
 Hint: f(x) == g(x) -> f(x) - g(x) == 0, then use Solve. Answer
Posted 1 month ago
 Thanks, I did try that, but the formatting of the command seems to be the biggest issue for me. Answer
Posted 1 month 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. Answer
Posted 1 month ago
 Thanks so much! I'll try that. Answer