2.8. USING MATLAB TO GRAPH 77

2.8 Using MATLAB to GraphSuppose you want to graph the function y = sin

(x2)

for x ∈ [0,5] . In MATLAB, you woulddo the following:

x=[0:.01:4];plot(x,sin(x.ˆ2),’LineWidth’,2)Then press enter and it will produce the graph of this function. Note that x is a list of

numbers between 0 and 4 which are .01 apart. x.ˆ2 says to make a list of numbers obtainedby squaring each number in the original list. This is why you need .ˆ rather than simply ˆ.You also need to press shift enter to get to a new line. Don’t forget to put ; after the firstline. You don’t want to see the list of numbers.

2.9 Exercises1. Define logarithms to the base b for b a positive real number, b ̸= 1, as follows. For

x > 0, logb (x) ≡ln(x)ln(b) .Show logb is one to one and maps onto R. Then show it

satisfies the same properties as ln . That is, logb (xy) = logb (x)+ logb (y) . Also showthat blogb(x) = x and logb (b

x) = x and logb (ax) = x logb (a) whenever a is a positive

real number.

2. Show that loge (x) = ln(x) .

3. Solve the following equation for x : log4 (2x)+3log3 (9

x) = 2

4. Show that for positive a and x, loga (x) =logb(x)logb(a)

5. Simplify logb (a) loga (b) where a,b are positive numbers not equal to 1.

6. Solve the following equations in terms of logarithms. Hint: Take natural logarithmsof both sides.

(a) 23x+1 = 32x−2.

(b) 5x−1

23x+1 = 7x

(c) 5x7x+1 = 2x

7. Find x such that logx (8) = 3.

8. Find x such that logx( 1

16

)= 4.

9. If 1 < a < b and x > 1, how are loga (x) and logb (x) related? Which is larger?Explain why.

10. Find without using a calculator log3 (27) , log2 (64) , log10 (1000) , log1/2 (8) .

11. Find the domain of the function of x given by log3

(x+1

(x−1)(x+2)

). Hint: You need x to

be such that the expression inside the parenthesis is positive and makes sense. Thusyou can’t have for example x = 1.

12. Find the domain of the function f (x) =√

ln( x+1

x+2

).