exp(ln(x))

diff(g(y),y$6);. 60 y6. > A:=2*x+t*(y+4); whattype(A); .... assume(x>-1): assume(y>0): combine(3*ln(x+1)+2*ln(y),ln); restart: combine(exp(a^2)*exp(b)^3,exp);.
151KB taille 4 téléchargements 437 vues
5 3

SESSION 01 > 2+3; 244*7; 3^4; 2/7; 2/3 + 5/7; > sqrt(5); exp(x); exp(ln(x)); e^(ln(x)); i^2; I^2; (1+i)*(1-i); (1+I)*(1-I); 5 e

Digits := 20 > evalf(5/3); 1.6666666666666666667

ln(x)

> evalf(5/3,20);

i2

1.6666666666666666667

-1 (1 + i) (1 - i) 2

x :=

5

y :=

2

> a; a+b; b*c; x^2+y; 7 9 10 7+

> evalf(5/7); 0.71428571428571428571 > evalf(sqrt(5));

> a:=5; b:=2; c:=3; x:=sqrt(a); y:=sqrt(b); a := 5 b := 2 c := 3

2

> restart; b; x; b x > A:=(2*x+2)*(5*x-3); B:=subs(x=(y+2)/(y-1),A); x; expand(A); simplify(B); A := (2 x + 2) (5 x - 3) ! 2 ( y + 2) $ ! 5 (y + 2) $ B := " + 2% " - 3% # y-1 & # y-1 & x 10 x 2 + 4 x - 6 2 (2 y + 1) (2 y + 13) (y - 1)2 > 5/3;

1.666666667 > Digits:=20;

x

x e

> evalf(5/3);

2.2360679774997896964 > evalf(Pi); evalf(pi); evalf(exp(1)); evalf(ln(2)); evalf(sin(Pi/2)); evalf(cos(pi/3)); 3.1415926535897932385 ! 2.7182818284590452354 0.69314718055994530942 1. cos(0.33333333333333333333 !) > evalf(1/1+sqrt(3),50); 2.7320508075688772935274463415058723669428052538104 > 1+(1/(1+(1/2))); evalf(%); ((1+2/3)/(1-2/3))*((3+5/4)/(3+7/3)); evalf(%); 5 3 1.6666666666666666667 255 64 3.9843750000000000000 > x:=7+sqrt(3); y:= 1- 5*sqrt(3); expand(x^2*y^3); expand(rationalize((x+y)/(x^2-y))); x := 7 + 3 y := 1 - 5

3

-4628 - 17116 3 106 178 3 253 759

> a:=cos(Pi/4); b:=sin(Pi/4); expand(rationalize((a+b^2)/(a^3 - b^4))); 1 a := 2 2 1 b := 2

2

6+4

2

t (y + 4) * * > L:=[(x+y-1)^3, (3*x+1)/(x+3), sin(a*x+b)]; for l in L do print(l); whattype(l); op(l); od; 3x+1 ' * L := ( (x + y - 1)3, , sin(a x + b)+ x+3 ) ,

> evalc((1+I)/(2+3*I)); evalc((1+I)^3); 5 1 I 13 13 -2 + 2 I

(x + y - 1)3

> x:=2+3*I*sqrt(5); y:=2-I*sqrt(3); evalf(Re(x^2/(x+y)),30); x := 2 + 3 I 5 y := 2 - I

+ 2

3

-.747650396133685080663798185792 > z:=1+I*sqrt(3); abs(z)*e^(argument(z)*I); z := 1 + I 3 ! 1 I !$ # 3 & 2e > restart; f:=x->x^2; g:=y->if y>=0 then (y^5-ln(y))/2 else 0 fi; simplify(combine((g@f)(y),ln)); g(f(4)); g(f(-2)); f := x - x 2 1 1 g := y - if 0 . y then y 5 - ln(y) else 0 end if; 2 2 Error, (in g) cannot determine if this expression is true or false: -y^2 diff(f(x),x); diff(g(y),y); 2x 5 4 1 y 2 2y > diff(g(y),y$6); 60 y6 > A:=2*x+t*(y+4); whattype(A); nops(A); op(2,A); whattype(op(1,A)); whattype(op(2,A)); A := 2 x + t (y + 4)

^ x + y - 1, 3 3x+1 x+3 * 3 x + 1,

1 x+3

sin(a x + b) function ax+b > L:=[1,2,a,x+y,1/x]; whattype(L); nops(L); 1* ' L := ( 1, 2, a, x + y, + x, ) list 5 > S:=seq(k^2,k=1..10); [S]; S := 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] > L:=[seq(x-k,k=1..5)]; whattype(L); nops(L); L := [x - 1, x - 2, x - 3, x - 4, x - 5] list 5 > for j from 1 to nops(L) do op(j,L) od; x-1 x-2 x-3 x-4 x-5

f := x - x 2

> l:=[seq(binomial(15,p),p=0..15)]; l := [1, 15, 105, 455, 1365, 3003, 5005, 6435, 6435, 5005, 3003, 1365, 455, 105, 15, 1]

4 2

> A:=5*x^2-6*x+2; convert(A,list); convert(A,`*`); L:=[seq(x-k,k=1..10)]; convert(L,`*`); expand(%);

x +1 x+1 A := +2x+1 x-1

2

A := 5 x - 6 x + 2 [5 x 2, -6 x, 2]

(x + 1)2

-60 x 3

(x - 1)2

L := [x - 1, x - 2, x - 3, x - 4, x - 5, x - 6, x - 7, x - 8, x - 9, x - 10] (x - 1) (x - 2) (x - 3) (x - 4) (x - 5) (x - 6) (x - 7) (x - 8) (x - 9) (x - 10) x

10

9

8

7

6

5

4

3

- 55 x + 1320 x - 18150 x + 157773 x - 902055 x + 3416930 x - 8409500 x + 12753576 x - 10628640 x + 3628800

> restart: L:=[seq(convert([seq((15-k+1)/k,k=1..p)],`*`),p=0..15)]; s:=0: for i from 1 to nops(L) do s:=s+L[i] od; convert(L,`+`); L := [1, 15, 105, 455, 1365, 3003, 5005, 6435, 6435, 5005, 3003, 1365, 455, 105, 15, 1] s := 1 s := 16 s := 121 s := 576 s := 1941 s := 4944 s := 9949 s := 16384 s := 22819 s := 27824 s := 30827 s := 32192 s := 32647 s := 32752 s := 32767 s := 32768 32768 > f:=x->1/x; A:=x+y+z; map(f,A); 1 x A := x + y + z f := x -

1 1 1 + + x y z > f:=x->x^2; map(f,1+1); map(f,x+1); A:=(x+1)/(x-1)+(2*x+1); map(f,A);

2

+ 4 x2 + 1

> f:=x->ln(1+x); X:=[0.1,0.5,1/2,1,4,10]; Y1:=map(f,X); Y:=map(evalf@f,X); f := x - ln(1 + x) 1 ' * X := ( 0.1, 0.5, , 1, 4, 10+ 2 ) , ' ! Y1 := ( 0.09531017980, 0.4054651081, ln" ) #

3$ * % , ln(2), ln(5), ln(11)+ 2& ,

Y := [0.09531017980, 0.4054651081, 0.4054651081, 0.6931471806, 1.609437912, 2.397895273] > L:=[seq((2*k+1)^3,k=0..19)]; convert(L,`+`); f:=x->(2*x+1)^3: K:=[seq(k,k=0..19)]; map(f,K); convert(%,`+`); L := [1, 27, 125, 343, 729, 1331, 2197, 3375, 4913, 6859, 9261, 12167, 15625, 19683, 24389, 29791, 35937, 42875, 50653, 59319] 319600 K := [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] [1, 27, 125, 343, 729, 1331, 2197, 3375, 4913, 6859, 9261, 12167, 15625, 19683, 24389, 29791, 35937, 42875, 50653, 59319] 319600 > factor(a^2-b^2); for k from 1 to 8 do factor(a^k-b^k) od; factor(x^3-x^2-3*x+3); factor(x^3-x^2-3*x+3,sqrt(3)); (a - b) (a + b) a-b (a - b) (a + b) (a - b) (a 2 + a b + b 2) (a - b) (a + b) (a 2 + b 2) (a - b) (a 4 + a 3 b + a 2 b 2 + a b 3 + b 4) (a - b) (a + b) (a 2 + a b + b 2) (a 2 - a b + b 2) (a - b) (a 6 + a 5 b + a 4 b 2 + a 3 b 3 + a 2 b 4 + a b 5 + b 6) (a - b) (a + b) (a 2 + b 2) (a 4 + b 4)

(x - 1) (x 2 - 3) (x +

3) (x -

! 1 $ 1 - tan " x% # 2 &

3) (x - 1)

! 1 $ 1 + tan " x% # 2 &

> restart: expand((x-2)^20); expand((5*x+(1/3))^7); 20

19

18

17

16

15

14

13

1048576 + x - 40 x + 760 x - 9120 x + 77520 x - 496128 x + 2480640 x - 9922560 x + 32248320 x 12 - 85995520 x 11 + 189190144 x 10 - 343982080 x 9 + 515973120 x 8 - 635043840 x 7 + 635043840 x 6 - 508035072 x 5 + 317521920 x 4 - 149422080 x 3 + 49807360 x 2 - 10485760 x 109375 6 21875 5 21875 4 4375 3 175 2 35 1 78125 x 7 + x + x + x + x + x + x+ 3 3 27 81 81 729 2187

2

(x + 1) (x

12

-x

10

8

6

4

2

ln((x~ + 1)3 y~ 2) e

1 ! (I x) 1 $% - I" e " 2 (I x)% " % e # &

> for i from 1 to 15 do A:=expand((x+1)^i): subs(x=1,[seq(op(j,A),j=1..nops(A))]): print(%); od: [1, 1]

> convert(sin(x),tan); convert(cos(x),tan); convert(sin(x),tan)/convert(cos(x),tan); ! 1 $ 2 tan " x% # 2 & ! 1 $ 1 + tan " x% # 2 &

[1, 7, 21, 35, 35, 21, 7, 1] [1, 8, 28, 56, 70, 56, 28, 8, 1] [1, 9, 36, 84, 126, 126, 84, 36, 9, 1] [1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1] [1, 1, 11, 55, 165, 330, 462, 462, 330, 165, 55, 11]

! 1 $ 1 - tan " x% # 2 & ! 1 $ 1 + tan " x% # 2 &

[1, 1, 12, 66, 220, 495, 792, 924, 792, 495, 220, 66, 12] [1, 1, 13, 78, 286, 715, 1287, 1716, 1716, 1287, 715, 286, 78, 13] [1, 1, 14, 91, 364, 1001, 2002, 3003, 3432, 3003, 2002, 1001, 364, 91, 14] [1, 1, 15, 105, 455, 1365, 3003, 5005, 6435, 6435, 5005, 3003, 1365, 455, 105, 15]

1 - tan (x)2

! 1 $ 1 - tan " x% # 2 &

16 sin(x) cos(x) - 12 sin(x) cos(x) + sin(x) 3 1 1 + cos(4 x) - cos(2 x) 8 8 2

ln(x +

x 2 + 1)

2

2

2

> simplify(convert(convert((1-exp(I*x))/(1+exp(I*x)),trig),tan)); 2

> convert(arcsinh(x),ln); convert(cos(x),tan);

2

! 1 $ 2 tan " x% # 2 &

> restart; expand(tan(2*x)); expand(sin(5*x)); combine(sin(x)^4,trig); 2 tan (x) 4

(a 2 + 3 b)

> convert(exp(I*x),trig); convert(sin(x),exp); cos(x) + I sin(x)

+ x - x + x - x + 1)

[1, 2, 1] [1, 3, 3, 1] [1, 4, 6, 4, 1] [1, 5, 10, 10, 5, 1] [1, 6, 15, 20, 15, 6, 1]

2

> assume(x>-1): assume(y>0): combine(3*ln(x+1)+2*ln(y),ln); restart: combine(exp(a^2)*exp(b)^3,exp);

> factor(expand(exp(a+b)+exp(a))); factor(x^14+1); a! b $ e # e + 1&

2

-

! 1 $ ! ! 1 $ $ tan " x% " -tan " x% + I% # 2 & # # 2 & & ! 1 $ 1 + I tan " x% # 2 &

> combine(sin(x)^6*cos(x)^5,trig);

-

5 5 5 1 1 5 cos(5 x) cos(3 x) + cos(x) cos(11 x) + cos(9 x) + cos(7 x) 1024 512 512 1024 1024 1024

> expand(sin(x)+sin(2*x)+sin(3*x)+sin(4*x)+sin(5*x)); factor(%); sin(x) - 2 sin(x) cos(x) - 8 sin(x) cos(x)2 + 8 sin(x) cos(x)3 + 16 sin(x) cos(x)4 sin(x) (2 cos(x) + 1) (2 cos(x) - 1) (4 cos(x)2 + 2 cos(x) - 1) > z:=(1+I*sqrt(3))/(1-I); convert(z,polar); ! 1 1 $ z := " + I% (1 + I # 2 2 & ! " " polar" " " #

! " " 2, arctan " " " #

3)

$ 1$ 3+ % % 2% % % + !% 1 1 % % 3 % % 2 2 & &

1 2

> a:=(1/2*3^(1/2)+1/2)/(1/2-1/2*3^(1/2)); expand(rationalize(a)); arctan(%); 1 1 3+ 2 2 a := 1 1 3 2 2 -2 - 3 5 ! 12 > somme:=proc(n) local i,resultat; if n somme(5); somme(4.5); somme(-3); somme(bonjour); 15 10

Le calcul est impossible Error, (in somme) cannot determine if this expression is true or false: bonjour < 0 > somme:=proc(n::integer) local i,resultat; if n somme(5); somme(4.5); somme(-3); somme(bonjour); 15 Error, invalid input: somme expects its 1st argument, n, to be of type integer, but received 4.5 Le calcul est impossible Error, invalid input: somme expects its 1st argument, n, to be of type integer, but received bonjour > factorielle:=proc(n::integer) if n=0 then 1 else n*factorielle(n-1) fi end: for i from 1 to 10 do factorielle(i) od; 1 2 6 24 120 720 5040 40320 362880 3628800 > st := time(): fib:=proc(n::integer)if n=0 then 1 elif n = 1 then 1 else fib(n-1)+fib(n-2) fi end: seq(fib(n),n=1..20); time() - st;

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946 0.350 > st := time(): fib:=proc(n::integer) option remember; if n=0 then 1 elif n = 1 then 1 else fib(n-1)+fib(n-2) fi end: seq(fib(n),n=1..20); time() - st; 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946 0. > st := time(): fib1:=proc(n::integer) expand((1+sqrt(5))^(n+1)-(1-sqrt(5))^(n+1))/(sqrt(5)*2^(n+1)) end: seq(fib1(n),n=1..20); time() - st; 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946 0. > rap:=proc(x,n::integer) local a,c,p: a:=x: c:=n: p:=1: while c > 0 do if (c mod 2)=1 then p := p*a fi: c:=iquo(c,2): a:=a*a od: end: > rap(3,5); 6561 >