The problem itself
(a) Now use fsolve (along with plot ) to find all the intersections of the graphs of and for x between -10 and 10. For each intersection, report both its x -coordinate and its y -coordinate.
(b) How many intersections do you think these curves have (over all values of x, not just from -10 to 10)?
> restart;
>
eq1 := x*sin(x):
eq2 := x-cos(x):
>
with(plots):
plot1 := plot({eq1,eq2},x=-10..10):
display(plot1);
>
> plot({x*sin(x),x-cos(x)},x=-5..-4);
> x1 := fsolve(eq1=eq2,x=-4.8..-4.6);
> x2 := fsolve(eq1=eq2,x=-4.6..-4);
>
> x3:= fsolve(eq1=eq2,x=1..2);
>
> plot({x*sin(x),x-cos(x)},x=7..8);
> x4 := fsolve(eq1=eq2,x=7..7.7);
> x5 := fsolve(eq1=eq2,x=7.7..8);
> point1:=[x1,y1];point2:=[x2,y2];
> subs({x=point1[1],y=point1[2]},eq1);
>