Lab1 Ex
Lab1 Ex
0. Read carefully and try the commands written in the file Lab1-Sage-tutorial.pdf or in the first 3 pages
of the file Lab-Maple8-tutorial.pdf
1
1. Evaluate the number using floating point arithmetic: ( 1./2) ; e= exp 1 ; 3 (sqrt(3.));
2
p (evalf(Pi) in Maple, numerical_approx(pi) in Sage) ; sin 0.1
2. Assign the following expression to a variable and then expand it:
2 3 2 5
a) x C2$x K1 $ x K2 b*) x Cn . Unassign the used variables (a:='a' in Maple, a=var('a')
in Sage).
8
3. Factorize: x -1
2
2$x 3$x
4. Add the following rational expressions by applying the factor command: 3
C 2
x K1 x K1
5. Simplify the trigonometric expression (In Maple using simplify(expression, trig) and in Sage using
2 2
expr.trig_simplify() ): sin x Ccos x
x
6. Evaluate using both subs and eval the expression e Cln x in x=1.
2
7. Solve: a) the equation x K4$x C3 = 0 where x is the unknown;
2
b) the equation x $y C2$y Kx = 0 where x is a parameter and y is the unknown;
2
c*) the equation x $y C2$y Kx = 0 where y is a parameter and x is the unknown;
d) the equation x Kcos x = 0 where x is the unknown; (for this equation one can find only approximate
roots. So, use fsolve in Maple, and find_root in Sage. Hint: it has 1 real root, and it belongs to the
interval [-1,1])
5 3
e*) the equation x K3$x K1 = 0 where x is the unknown; (for this equation one can find only
approximate roots. So, use fsolve in Maple, and find_root in Sage. Hint: it has 3 real roots, all in the
interval [-2,2])
f) the system of two equations 4 x C 3 y = 10, 3 x Ky = 1 where x and y are the unknowns.
x
8* (only in Maple). Assign to a variable f the function (not the expression) f : R/R, f x = e Ksin x .
Evaluate f 0 , f K1 , f' 0 , f' 1 . Calculate the first and second order derivatives of f (using both D
1
and diff) and a primitive of f. Evaluate f x dx . Unassign f. Do not forget that for f'(0) (the
K1
derivative of a function in a given point you just have to write D(f)(0)).
x
9. Assign to a variable g the expression e Ksin x . Evaluate this expression in x = 0. Compute its first
1
order derivative and then evaluate it in x = 0 . Find a primitive. Evaluate g dx. Assign to a variable f
K1
the second order derivative of g and evaluate it in x = 0.
sin x cos x C1
10. Find lim and lim
x/p
.
x/0 x x Kp
11. First plot the graph of f x = sin x by hand on paper. Then plot it using Sage in the interval
0, 2$p , or using Maple, in each of the intervals: 0, 2$p , K4 p, 4$p , K100, 100 , KN, N .
1
12. First plot the graph of f x = by hand on paper. Then plot it using Maple or Sage in the
x
interval [-1,1]. In Sage use the option detect_poles=True and specify a range for the values of this
function.
2 3
13. Plot the planar curve of parametric equations x = 2 Kt , y = t Kt , t 2 K2, 2 .
14. First plot by hand on paper the planar curve of parametric equations x = cos t , y = sin t in each
p p p 3$p
of the intervals: 0, , 0, , 0, , 0, p , 0, , 0, 2$p , 0, 4$p .
6 3 2 2
Then do the same using Maple or Sage. What do you notice?
t t
15*. Plot the planar curves of parametric equations a) x = 2$ cos , y = 2$ sin
3 3
b) x = cos 4$ t , y = sin 4$ t in different intervals at your choice. What do you notice?
16. Write by hand on paper the implicit equations of a circle centered in (9,10), an ellipse and a
parabola. Then plot using Maple or Sage at leats a circle, an ellipse and a parabola.
2 2
17. Plot the planar curves of implicit equations a) x K2$x$y Ky = 1 b*)
3 2 2
y Cy K5$y Kx =K4 . You have to choose properly a rectangle where to see the curve.
2 2
18. First draw by hand on paper the graph of the function H x, y = x Cy . Then plot it in 3d using
Maple or Sage (using the command plot3d). For the variable (x,y) choose a rectangle centered at (0,0).
What remarkable planar curves are the level curves of H?