Exercises

 

Back to Maple Tutorial Table of Contents

(Before you attempt this lesson, you should be familiar with all previous lessons. This lesson relies heavily on previously discussed material and assumes you are totally familiar with all the material.)

Maple lets you solve equations using the solve command. This is great if you need a quick answer, but what do you do if you need to see the work in between? A good method is to solve it yourself using Maple's equation handling functions.

However, there is a caveat:

If you use this method, you cannot use a function to undo another if the two functions are not inverses. For example:

> x^2=4;

[Maple Math]

> sqrt(x^2)=sqrt(4);

[Maple Math]

If we try to simplify that, it gives you this ugly equation that basically means x=[2,-2]. This happens because x2 and the square root of x are not inverses.

It's usually best to only use this trick with linear equations, but, later, we will learn some tricks to overcome this caveat.

Let's take a look at the Maple commands we will use.

lhs(a = b) = a

rhs(a = b) = b

lhs(a + 2x = [Maple Math]) = a + 2x

rhs(a + 2x = [Maple Math]) = [Maple Math]

This gives us a nice way to take equations apart and perform algebra on each side. Let's solve a simple, two-step equation to put lhs and rhs in action.

Solve 2x + 2 = 12 for x

> 2*x+2=12; #Enter the eqn into Maple so we can use %

[Maple Math]

> lhs(%)-2=rhs(%)-2; #Subtract 2 from both sides. Notice Maple isn't assigning anything because we aren't using :=

[Maple Math]

> lhs(%)/2=rhs(%)/2; #Divide both sides by 2

[Maple Math]

> solve(2*x+2=12,x); #Let's check our answer by using Maple's automated solver

[Maple Math]

Our answer checks out. Let's try a harder equation.

[Maple Math]

> (4*x+14)/3=22/3; #Enter the eqn

[Maple Math]

> #Notice how Maple broke up the left fraction? It likes to do that.

> lhs(%)*3=rhs(%)*3; #Eliminate the denominators

[Maple Math]

> lhs(%)-14=rhs(%)-14; #Subtract 14 from both sides

[Maple Math]

> lhs(%)/4=rhs(%)/4; #Finish it!

[Maple Math]

Let's try one with trig functions!

[Maple Math]

Solve for x

> y=sec(y)+(x/sec(y)); #State eqn

[Maple Math]

> lhs(%)-sec(y)=rhs(%)-sec(y); #Subtract sec(y) from both sides

[Maple Math]

> lhs(%)*sec(y)=rhs(%)*sec(y); #Multiply both sides by sec(y)

[Maple Math]

> expand(lhs(%))=rhs(%); #Let's expand that

[Maple Math]

> rhs(%)=lhs(%); #Let's flip it so x is on the left

[Maple Math]

Caveat: You can't undo trig functions; you can only move them around!

Let's try one with exponentials.

[Maple Math]

> 2^a=2^(b+3);

[Maple Math]

> log[2](lhs(%))=log[2](rhs(%)); #Raise both sides to base log2

[Maple Math]

> simplify(%); #Maple gave us the change of base formula. This will simplify.

[Maple Math]

Note: We can simplify the whole equation as a unit. Be careful; some Maple commands will not take a full equation.

> lhs(%)-3=rhs(%)-3; #Now we can finish it

[Maple Math]

> rhs(%)=lhs(%); #Flip it!

[Maple Math]

In summary, here's what you can do with lhs and rhs:

c any expression

a = b

Operation

Math Notation

Maple Syntax

Add a + c = b + c lhs(%)+c=rhs(%)+c
Subtract a - c = b - c lhs(%)-c=rhs(%)-c
Multiply ac = bc lhs(%)*c=rhs(%)*c
Divide [Maple Math] lhs(%)/c=rhs(%)/c
Expand/simplify one side   simplify(lhs(%))=rhs(%)
lhs(%)=expand(rhs(%))
Raise to base c ca = cb c^lhs(%)=c^rhs(%)
Remove base c logcca = logccb log[c](lhs(%))=log[c](rhs(%))
Flip an equation b = a rhs(%)=lhs(%)

 

Top