Previous Up Next

6.21.1  Primitive et intégrale définie : integrate Int integrer int integration

integrate (ou int) permettent de calculer une primitive ou une intégrale définie. La seule différence entre ces deux commandes est que integrate écrit avec le symbole ∫ la réponse de la commande quest() qui suit l’évaluation de integrate.
Par contre Int renvoie integrate sans l’évaluer : c’est pour avoir la compatibilité avec Maple, lorsque l’on fait un calcul numérique d’intégrales :
On tape :

Int(exp(x),x,0,1))

On obtient :

integrate(exp(x),x,0,1)

On tape :

int(exp(x),x,0,1))

On obtient :

exp(1)-1)

On tape :

evalf(Int(exp(x^2),x,0,1))

Ou on tape :

evalf(int(exp(x^2),x,0,1))

On obtient :

1.46265174591

integrate (ou int ou Int) a un, deux ou quatre arguments.

Exercice 1
Soit

f(x)=
x
x2−1
+ln(
x+1
x−1
)

Calculer une primitive de f.
On tape :

int(x/(x^2-1)+ln((x+1)/(x-1)))

On obtient :

x*log((x+1)/(x-1))+log(x^2-1)+1/2*log(2*x^2/2-1)

Si on a cocher Pas à pas dans la configuration générale on a en plus, en vert, le détail du calcul :

Integration of x/(x^2-1): f(u)*u' where f=x->1/(x*2-1) and u=(x^2)/2
Integrate rational fraction 1/(2*x-1)
Integration of ln((x+1)/(x-1)) by part of u*v' where u=1 and v=ln((x+1)/(x-1))'
Integrate rational fraction with denominator x^2-1=0
roots are deduced from nth-roots of unity

Ou bien on définit la fonction f en tapant :

f(x):=x/(x^2-1)+ln((x+1)/(x-1))

puis on tape :

int(f(x))

On obtient bien sûr le même résultat.
Attention
Pour Xcas, log est égal à ln (logarithme népérien) et log10 est le logarithme en base 10.
Exercice 2
Calculer :

2
x6+2 · x4+x2
  dx 

On tape :

int(2/(x^6+2*x^4+x^2))

On obtient :

2*((3*x^2+2)/(-(2*(x^3+x)))+-3/2*atan(x))

Si on a cocher Pas à pas dans la configuration générale on a en plus, en vert, le détail du calcul :

Integrate rational fraction 1/(x^3+x)^2
Partial fraction 1/(x^3+x)^2 -> Hermite reduction -> 
         integrate squarefree part -(3*x)/(2*x^3+2*x)

Exercice 3
Calculer :

1
sin(x)+sin(2 · x )
  dx 

On tape :

integrate(1/(sin(x)+sin(2*x )))

On obtient :

(1/-3*log((tan(x/2))^2-3)+1/12*log((tan(x/2))^2))*2

Si on a cocher Pas à pas dans la configuration générale on a en plus, en vert, le détail du calcul :

Integrate rational fraction of trigonometric 1/(sin(x)+sin(2*x)) by tan(x/2) change of variable, 
              leading to integral of 1/((1+x^2)*((2*x)/(x^2+1)+(2*(1-x^2)/(x^2+1)*2*x)/(x^2+1)))
Integrate rational fraction 1/((1+x^2)*((2*x)/(x^2+1)+(2*(1-x^2)/(x^2+1)*2*x)/(x^2+1))), 
               change of variable x=x^2
Integrate rational fraction (-x-1)/(4*x^2-12*x)

Previous Up Next