]> Exercises

Exercises

Solve and plot the following systems of equations

    Use Commands

  1. sin ( 3 x ) cos ( x ) = y
    y = 0

    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 several fsolve 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})
              
  2. x 5 = y
    1 + sin ( x ) = y

    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})

  3. y = x 2
    ( y 1 ) 2 = sin ( x )

    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 plot builder to plot

  1. sin ( 3 x ) cos ( x ) = y
    y = 0

    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 several fsolve 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})
              
  2. x 5 = y
    1 + sin ( x ) = y

    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})