•Tentti 2

•Tehtävä 1

In[1]:=

Remove["Global`*"]

In[2]:=

f = x^4 y^2/(x^4 + y^2)^2

Out[2]=

(x^4 y^2)/(x^4 + y^2)^2

In[3]:=

Plot3D[f, {x, -2, 2}, {y, -2, 2}, PlotPoints -> {200, 200}, Mesh -> False]

[Graphics:HTMLFiles/ratk2_5.gif]

Out[3]=

-SurfaceGraphics -

•Tehtävä 2

In[4]:=

Remove["Global`*"]

In[5]:=

p = a (x + 3) (x + 2) (x - 1) (x - 5) // Expand

Out[5]=

30 a - 11 a x - 19 a x^2 - a x^3 + a x^4

In[6]:=

kerroin = Solve[(p /. x -> 2) == 5, a]

Out[6]=

{{a -> -1/12}}

In[7]:=

p = p /. kerroin[[1]]

Out[7]=

-5/2 + (11 x)/12 + (19 x^2)/12 + x^3/12 - x^4/12

In[8]:=

p1 = D[p, x]

Out[8]=

11/12 + (19 x)/6 + x^2/4 - x^3/3

In[9]:=

derivNollakohdat = NSolve[p1 == 0, x]

Out[9]=

{{x -> -2.5512100270550038`}, {x -> -0.2993736500083017`}, {x -> 3.6005836770633053`}}

In[10]:=

maxJaMin = p /. derivNollakohdat

Out[10]=

{0.5528049413191574`, -2.6354255741766712`, 11.211201362024182`}

In[11]:=

Plot[p, {x, -4, 5}]

[Graphics:HTMLFiles/ratk2_21.gif]

Out[11]=

-Graphics -

•Tehtävä 3

In[12]:=

Remove["Global`*"]

In[13]:=

{a, b, c, d} = {77520, 125970, 167960, 184756}

Out[13]=

{77520, 125970, 167960, 184756}

In[14]:=

syt = GCD[a, b, c, d]

Out[14]=

646

In[15]:=

pyj = LCM[a, b, c, d]

Out[15]=

11085360

In[16]:=

FactorInteger[syt]

Out[16]=

{{2, 1}, {17, 1}, {19, 1}}

•Tehtävä 4

In[17]:=

Remove["Global`*"]

In[18]:=

y = Sin[x Log[x]]

Out[18]=

Sin[x Log[x]]

In[19]:=

Plot[y, {x, 1, 5}, PlotRange -> All, AxesOrigin -> {1, 0}]

[Graphics:HTMLFiles/ratk2_36.gif]

Out[19]=

-Graphics -

In[20]:=

x1 = x /. First[FindRoot[y == 0, {x, 3}]]

Out[20]=

2.926064059150203`

In[21]:=

x2 = x /. First[FindRoot[y == 0, {x, 4}]]

Out[21]=

4.304530345053695`

In[22]:=

y1 = D[y, x]

Out[22]=

Cos[x Log[x]] (1 + Log[x])

Tilavuus:

In[23]:=

NIntegrate[Pi y^2, {x, 1, x1}]

Out[23]=

2.890092823350428`

In[24]:=

NIntegrate[Pi y^2, {x, 1, x2}]

Out[24]=

5.0471969584885645`

Pinta-ala:

In[25]:=

NIntegrate[2 Pi y Sqrt[1 + y1^2], {x, 1, x1}]

Out[25]=

10.142645316081827`

Toisessa tapauksessa on otettava huomioon, että y:n merkki vaihtuu. Joko

In[26]:=

NIntegrate[2 Pi Abs[y] Sqrt[1 + y1^2], {x, 1, x2}]

NIntegrate :: ncvb :  NIntegrate failed to converge to prescribed accuracy after  7  recursive bisections in  x  near  x  =  2.9233399273945335` .

Out[26]=

18.88108794379967`

tai sitten

In[27]:=

NIntegrate[2 Pi y Sqrt[1 + y1^2], {x, 1, x1}] - NIntegrate[2 Pi y Sqrt[1 + y1^2], {x, x1, x2}]

Out[27]=

18.881079060657846`

•Tehtävä 5

In[28]:=

Remove["Global`*"]

In[29]:=

lsk = Sin[51 x]

Out[29]=

Sin[51 x]

In[30]:=

lsk1 = TrigExpand[lsk]

Out[30]=

51 Cos[x]^50 Sin[x] - 20825 Cos[x]^48 Sin[x]^3 + 2349060 Cos[x]^46 Sin[x]^5 - 115775100 Cos[x] ... 43 + 18009460 Cos[x]^6 Sin[x]^45 - 249900 Cos[x]^4 Sin[x]^47 + 1275 Cos[x]^2 Sin[x]^49 - Sin[x]^51

In[31]:=

lsk2 = lsk1 /. Cos[x] -> Sqrt[1 - Sin[x]^2] // Expand

Out[31]=

51 Sin[x] - 22100 Sin[x]^3 + 2864160 Sin[x]^5 - 175668480 Sin[x]^7 + 6226471680 Sin[x]^9 - 142 ... Sin[x]^45 - 86131342873460736 Sin[x]^47 + 14355223812243456 Sin[x]^49 - 1125899906842624 Sin[x]^51


Converted by Mathematica  (August 27, 2003)