Sol Butlleti 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Butlletí 3.

Integració
(* Sempre podeu buscar informació d'un comandament en concret en la opció "Help",
amunt a la dreta . *)

1. Integrals indefinides
3.5.
(* Podeu comprovar la descomposició en
fraccions parcials amb el comandament Apart [fracció ] *)

In[  ]:= Apart [(x ^ 2) / (x + 1)]


1
Out[  ]= -1 + x +
1+x

In[  ]:= Apart [(5 x ^ 2 + 6 x + 9) / ((x - 3) ^ 2 (x + 1) ^ 2)]


9 1
Out[  ]= +
2
2 (- 3 + x) 2 (1 + x)2

2. Integrals definides
3.10
1)

(* Definim les funcions *)

In[  ]:= f[x_] := x ^ 2 - 2


g[x_] := 2

(* Podem obtindre els punts de tall resolguent l'equació f(x)=


g(x) amb el comandament Solve [equació , variable ] *)

In[  ]:= Solve [f[x] ⩵ g[x], x]


Out[  ]= {{x → - 2}, {x → 2}}

(* Podem dibuixar les dues funcions en l'interval [- 5,5] amb el


comandament Plot [{ funció1 [x], funció2 [x] }, {x,xmin ,xmax }]. Per a què aparega
una llegenda amb el nom de les funcions podem afegir PlotLegends →
"Expressions " com a argument del comandament Plot. *)

Printed by Wolfram Mathematica Student Edition


2 Sol_Butlleti_3.nb

In[  ]:= Plot [{f[x], g[x]}, {x, - 5, 5}, PlotLegends → "Expressions "]

20

15

f (x )
Out[  ]=
10
g(x )

-4 -2 2 4

(* Com g(x) està per damunt en l'interval [- 2,2], calculem l'integral de g(x)- f(x). *)

In[  ]:= Integrate [g[x] - f[x], {x, - 2, 2}]


32
Out[  ]=
3

2)

(* Definició de funcions *)

In[  ]:= f[x_] := x ^ 4 - 4 x ^ 2 + 4


g[x_] := x ^ 2

(* Punts de tall *)

In[  ]:= Solve [f[x] ⩵ g[x], x]


Out[  ]= {{x → - 2}, {x → - 1}, {x → 1}, {x → 2}}

(* Dibuixar funcions *)

In[  ]:= Plot [{f[x], g[x]}, {x, - 3, 3}, PlotLegends → "Expressions "]

15

10 f (x )
Out[  ]=
g(x )

-3 -2 -1 1 2 3

Printed by Wolfram Mathematica Student Edition


Sol_Butlleti_3.nb 3

(* També podem dir - li a Mathematica que integre


directament el valor absolut de f(x)- g(x) entre - 2 i 2 *)

In[  ]:= Integrate [Abs [f[x] - g[x]], {x, - 2, 2}]


Out[  ]= 8

(* Fixeu - vos en què obtindriem un resultat distint sense el valor absolut *)

In[  ]:= Integrate [f[x] - g[x], {x, - 2, 2}]


32
Out[  ]=
15

Printed by Wolfram Mathematica Student Edition

You might also like