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?
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.
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.
Thanks so much! I’ll try that.