%	TEST ONE A, Eight marks
%
%	QUESTION ONE
>> syms x; g=((x^2)*(tan(2*x)))/(2 - (sin(x))^2)
>> pretty(g)
>> X=-3 : 0.5 : 6;
>> Y=subs(g,X);
>> Xt=transpose(X); 			%One can also use Xt = X’
>> Yt=transpose(Y); 			%But I prefer transpose(X).
>> [Xt Yt]
%One mark was given for getting the correct values.
%One mark was given for putting the values in a table.
%
%	QUESTION TWO
>> syms y;
>> z= exp(2*x) - (x - y)^3 + (3*y + 1)/(1+log(abs(2*x)))
>> pretty(z)
>> zx=subs(z,x,-1.7);
>> zxy=subs(zx,y,1.5);
>> zxy
%One Mark was given for getting the correct value.
%
%	QUESTION THREE
>> f=(x^2 + 2*x + 7)/(x^2 +3*x + 10)
>> pretty(f) 				%pretty is good to use for checking the
>> ezplot(f,[-3 3]) 			%function input is correct.
>> hold
% >> xlabel('x label goes here')		Written later to prevent over writing
% >> ylabel('y label goes here')
% >> title('title goes here')
%One mark was given for using ezplot correctly.
%One function was given for labelling the graph. If no graph was saved on
%the disc half marks were given for correctly using the labelling commands .
%
>> df=diff(f);
>> pretty(df)
%One mark was given for obtaining the derivative.
%
>> x1 = 0;
>> m=subs(df,x1);
>> y1=subs(f,x1);
>> y=m*(x-x1)+y1;
>> pretty(y)
>> ezplot(y,[-3 3])
%One mark was given for plotting the tangent correctly.
%
>> xlabel('x label goes here')
>> ylabel('y label goes here')
>> title('title goes here')
%
%	QUESTION FOUR
>> limf= (4 - 5/(x^2) - 3/(x^4))/((1 - 1/(x^2))^2);
>> pretty(limf)
>> limit(limf,0)
%one mark was given for getting the correct value.

=======================================================================

Output for above:
g =
 
x^2*tan(2*x)/(2-sin(x)^2)

 
                                   2
                                  x  tan(2 x)
                                  -----------
                                            2
                                  2 - sin(x)

ans =

  1.0e+003 *

   -0.0030    0.0013
   -0.0025    0.0129
   -0.0020   -0.0039
   -0.0015    0.0003
   -0.0010    0.0017
   -0.0005   -0.0002
         0         0
    0.0005    0.0002
    0.0010   -0.0017
    0.0015   -0.0003
    0.0020    0.0039
    0.0025   -0.0129
    0.0030   -0.0013
    0.0035    0.0057
    0.0040   -0.0762
    0.0045   -0.0088
    0.0050    0.0150
    0.0055   -4.5500
    0.0060   -0.0119

z =
 
exp(2*x)-(x-y)^3+(3*y+1)/(1+log(2*abs(x)))

 
                                      3       3 y + 1
                    exp(2 x) - (x - y)  + ----------------
                                          1 + log(2 | x |)

zxy =

   35.2746

 f =
 
(x^2+2*x+7)/(x^2+3*x+10)

                                  2
                                 x  + 2 x + 7
                                 -------------
                                  2
                                 x  + 3 x + 10
Current plot held
 
                                     2
                      2 x + 2      (x  + 2 x + 7) (2 x + 3)
                   ------------- - ------------------------
                    2                    2            2
                   x  + 3 x + 10       (x  + 3 x + 10)
 
                               - 1/100 x + 7/10
 
                                     5      3
                                4 - ---- - ----
                                      2      4
                                     x      x
                                ---------------
                                  /     1  \2
                                  |1 - ----|
                                  |      2 |
                                  \     x  /
 ans =
 
-3