Lab 3: MATLAB Symbolic Math Toolbox

Qifan Wang

1 Introduction

This exercise introduces the various solvers that Matlab has, including the symbolic one and numeric solver, and using plots to find solutions to the equations.

2 Procedure

  1. Find the two solutions of

    x 2 - 7 x + 6 = 0

    The answers are 1 and 6.

  2. Solve

    { 2 x + y - 2 z = 3 2 x - y - 2 z = 0 x + y + 3 z = 12

    The answer is { x = 51 / 16 y = 3 / 2 z = 39 / 16 .

  3. Find centers of the two circles with radius 6 that that intersects at ( 4 , 1 ) and ( 6 , 1 ) .

    The answer is C 1 = ( 5 , 1 - 35 ) and C 2 = ( 5 , 1 + 35 ) .

  4. Solve c o s ( x ) = x 2 - 6 .

    The numberic solver gives ± 2.3081709562982061315028462760179 .

    The plot shows intersections at (-2.30819,-0.672246) and (-2.30952,-0.673348).
    Figure 4.1 Plot of c o s ( x ) and x 2 - 6 .
  5. How many solutions does c o s ( x ) = s i n ( x ) have? Find the first three positive solutions.

    There are infinitely many solutions, the first three solutions that are greater than 0 are 0.78539816339744830961566084581988, 3.9269908169872415480783042290994, 7.0685834705770347865409476123789.

  6. Give a equation of form f ( x ) = g ( x ) that f ( x ) crosses g ( x ) which is a function with two real roots two times.

    2 x = ( x - 3 ) 2 - 3 .

    The plot shows intersections at (0.838277,1.67655) and (7.16274,14.3255).
    Figure 6.1 Plot of 2 x and ( x - 3 ) 2 - 3 .

3 Feedback

This exercise requires to install additional Symbolic Math Toolbox, in additions to the regular installation of Matlab.

I used sections to organize the problem solutions in the Matlab script. fplot() is used instead of the ezplot() for the later is not recommended in the help documentation.

Appendix A. Matlab source file

Lab3.m