> y1 := solve(2*x+3*y=7,y); > y2 := solve(3*x-y=1,y); > x_value := solve(y1=y2,x); > subs(x=x_value,y1); > subs(x=x_value,y2);When asked to find an intersection point, you must remember not to just give the
> solve({equation1,equation2,equation3,...},{variable1,variable2,variable3,...});The first argument of the solve command is the set of equations to be solved and the second argument is the set variables to be solved for. So, using the example above, we can find the
> solve({2*x+3*y=7,3*x-y=1},{x,y});As you can see, this method only required one Maple command to get both the
Also, recall that not all equations can be solved analytically. When the solve command yields a strange looking answer, it does not necessarily mean that there are no solutions. You may have to solve the equations numerically. The fsolve command has the same syntax as the solve command, however it does not always yield all solutions at once. If your plot indicates that you have more intersection points than what the fsolve command has shown, then you must solve for each solution separately using ranges of and
values.
Suppose we want to find all intersection points of and
. You would find that if you try to use the solve command, you would get an answer involving Root of ... which means that it cannot be solved analytically. To solve numerically in Maple, you can try the following Maple procedure.
> plot({x^2-4*x-2,3*sin(x)},x=-5..5);The plot shows that there are two intersection points. The commands below show how we can find both.
> fsolve({y=x^2-4*x-2,y=3*sin(x)},{x=-2..0,y=-10..10}); > fsolve({y=x^2-4*x-2,y=3*sin(x)},{x=0..5,y=-10..10});Note the use of the ranges for the
This last example shows a similar procedure using implicit equations. Suppose we want to know where the graph of the equation
intersects with the graph of
. First a plot would be necessary to determine the number of intersection points. Then the fsolve command can be used with ranges specified for
and
.
> with(plots): > implicitplot({x*y-y^2+2=2*x^2-1,x/y+y=x*y},x=-5..5,y=-5..5); > fsolve({x*y-y^2+2=2*x^2-1,x/y+y=x*y},{x=-2..0,y=0..1}); > fsolve({x*y-y^2+2=2*x^2-1,x/y+y=x*y},{x=-2..0,y=-1..0});