Exercises
Solve and plot the following systems of equations
-
eq1:=sin(3x)-cos(x)=y
eq2:=y=0
plot({lhs(eq1), rhs(eq2)}, x=-10..10)
sols:=solve({eq1, eq2}, {x, y})
allvalues(sols[1])
allvalues(sols[2])
allvalues
fails so severalfsolve
commands are required to find the three roots in the plot.s1:=fsolve({eq1, eq2}, {x=0.1..1, y=-0.1..0.1}) s2:=fsolve({eq1, eq2}, {x=-1..-0.1, y=-0.1..0.1}) s3:=fsolve({eq1, eq2}, {x=-0.7..0.7, y=-0.1..0.1})
-
eq3:=x^5=y
eq4:=1+sin(x)=y
plot({lhs(eq3), lhs(eq4)}, x=-10..10, y=-10..10)
fsolve({eq3, eq4}, {x, y})
-
eq5:=y=x^2
eq6:=(y-1)^2=sin(x)
with(plots):
implicitplot({eq5, eq6}, x=-1..4, y=-1..3)
fsolve({eq5, eq6}, {x=0..1, y=0..0.5})
fsolve({eq5, eq6}, {x=1..2, y=1.5..3})
Use Commands
-
Note: These are the same equations used in problem one of the commands section. Use the same document so that the equations do not have to be reassigned.
(open PlotBuilder assistant)
(for expressions use lhs(eq1) and rhs(eq2))
(Use default settings and plot)
sols:=solve({eq1, eq2}, {x, y})
allvalues(sols[1])
allvalues(sols[2])allvalues
fails so severalfsolve
commands are required to find the three roots in the plot.s1:=fsolve({eq1, eq2}, {x=0.1..1, y=-0.1..0.1}) s2:=fsolve({eq1, eq2}, {x=-1..-0.1, y=-0.1..0.1}) s3:=fsolve({eq1, eq2}, {x=-0.7..0.7, y=-0.1..0.1})
-
Note: These are the same equations used in problem two of the commands section. Use the same document so that the equations do not have to be reassigned.
(open PlotBuilder assistant)
(for expressions use lhs(eq3) and lhs(eq4))
(Use default settings and plot)fsolve({eq3, eq4}, {x, y})
Use plot builder to plot