Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- limit exists, value:
- f[x_, y_] = (x^2 - y^2)/(x^2 + y^2)
- Limit[f[x, y] /. x -> 0, y -> 0]
- Limit[f[x, y] /. x -> y, y -> 0]
- f[x_, y_] = (x^2 - y^2)/(x^2 + y^2)
- Limit[f[x, y] /. x -> 1, y -> -1]
- Limit[f[x, y] /. x -> 1, y -> 0]
- (*Since in both exercises we have found different values of the \
- limits along different curves, we can conclude that these limits do \
- not exist*)
- ************
- Find the local maximum, local minimum and saddle points of the given function
- and show them on the same graph with the function (if they exist).
- f[x_, y_] = x^3 - y^3 - 2*x*y + 6;
- fx[x_, y_] = D[f[x, y], x];
- fy[x_, y_] = D[f[x, y], y];
- Solve[fx[x, y] == 0 && fy[x, y] == 0] // N
- (* critical points are (-2/3,2/3) and (0,0)*)
- d[x_, y_] =
- D[fx[x, y], x]*D[fy[x, y], y] - D[fx[x, y], y]*D[fy[x, y], x];
- d[0, 0]
- d[-2/3, 2/3]
- (* (0,0) is a saddle point*)
- fxx[x_, y_] = D[fx[x, y], x];
- fxx[-2/3, 2/3]
- fyy[x_, y_] = D[fy[x, y], y];
- fyy[-2/3, 2/3]
- (* (-2/3,2/3) is a local maximum since d>0 and fxx<0*)
- l = ListPointPlot3D[{{0, 0, f[0, 0]}, {-2/3, 2/3, f[-2/3, 2/3]}},
- PlotStyle -> PointSize[0.03]];
- p = Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2}];
- Show[p, l]
- c = ContourPlot[f[x, y], {x, -2, 2}, {y, -2, 2}]
- ******************
- Find the global extreme value of the function f(x,y) in the given domain. Then show the graph of the
- function together with the global extreme.
- [x_, y_] = x + y;
- NMinimize[{f[x, y], x^2 + y^2 == 4}, {x, y}]
- NMaximize[{f[x, y], x^2 + y^2 == 4}, {x, y}]
- l = ListPointPlot3D[{{-1.4142135686219075, -1.414213566660994, \
- -2.828427135282902}, {1.4142135636943396, 1.414213568044784,
- 2.8284271317391236}}, PlotStyle -> PointSize[Large]];
- p = Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2}];
- Show[p, l]
- ************************************
- r=sin+cos; r=nsin:
- PolarPlot[Sin[3*t] + Cos[2*t], {t, 0, 2*Pi}]
- ParametricPlot[{Cos[t]*(Sin[3*t] + Cos[2*t]),
- Sin[t]*(Sin[3*t] + Cos[2*t])}, {t, 0, 2*Pi}]
- ;;;;;;;;;;;;;;;;;;;;;;;;
- tabela = Table[n*Sin[t], {n, 0, 10, 1}];
- PolarPlot[Evaluate[tabela], {t, 0, 2*Pi}]
- (*you may use Table directly together with ListPlot or \
- ListPointPlot3D but not with Plot od PolarPlot, ParametricPlot etc.*)
- \
- (*first make the table, then use evaluate in the plotting step!*)
- ***********************************
- Recursive Sequence, general term, convergence, partial sums:
- RSolve[{a[n] == a[n - 1] + 1/2^n, a[1] == 1/2*Sum[1/2^k,{k,0,Infinity}], a[n], n]
- Limit[2^(-1 - n) (-2 + 3 2^n),
- n -> Infinity] (*finding general term*)
- Graphics[Point[Table[{n, 2^(-1 - n) (-2 + 3 2^n)}, {n, -3, 5, 1}]],
- Axes -> True] (*sequence converges to 1.5*)
- Sn = Sum[2^-n (-1 + 2^n), {n, 1, Infinity}]
- Limit[Sn, n -> Infinity] (*series diverges*)//Unneccessery
- *****************************************
- Maclaurin,graphs, error:
- f[x_] = (2 x - 1)^2*Sin[x + 1];
- table = Table[Normal[Series[f[x], {x, 0, n}]], {n, 1, 10, 1}];
- a = Plot[Evaluate[table], {x, 0, 6},
- PlotStyle -> Blue]; (*you may use Evaluate[table] in this case*)
- b = Plot[f[x], {x, 0, 6}, PlotStyle -> Red];
- Show[a, b]
- g2[x_] = Normal[Series[f[x], {x, 0, 2}]];
- c = ListPlot[Table[{x, g2[x]}, {x, 0.1, 4.6, 0.5}],
- PlotStyle -> {PointSize[Large],
- Green}]; (*you may use listplot with table together*)
- Table[Abs[g2[x] - f[x]], {x, 0.1, 4.6,
- 0.5}](*table of error in approximation values*)
- d = Plot[g2[x], {x, 0, 6}, PlotStyle -> Blue];
- Show[b, c, d]
- *************************************
- region A, between two curves, area, perimeter, volume of solid, area of solid
- f[x_] = -(x - 2)^2 + 4;
- g[x_] = x/(x + 1);
- Plot[{f[x], g[x]}, {x, 0, 5}]
- FindRoot[f[x] == g[x], {x, 4}]
- {x -> 3.79128784747792`}
- Integrate[f[x] - g[x], {x, 0, 3.79129}] (*calculating area of region A*)
- o1 = Integrate[Sqrt[1 + (f'[x])^2], {x, 0, 3.79129}] (*arc length of f*)
- o2 = Integrate[Sqrt[1 + (g'[x])^2], {x, 0, 3.79129}] (*arc length of g*)
- perimeter = o1 + o2
- Integrate[2*Pi*x*(f[x] - g[x]), {x, 0, 3.79129}](*volume of revolving region around y-axis*)
- Solve[y == -(x - 2)^2 + 4, x]
- Solve[y1 == x/(x + 1), x]
- h[y_] = 2 - Sqrt[4 - y]
- h1[y_] = D[h[y], y]
- k[y_] = 2 + Sqrt[4 - y]
- k1[y_] = D[k[y], y]
- p[y_] = -y/(y - 1)
- p1[y_] = D[p[y], y]
- A1 = Integrate[2*Pi*h[y]*Sqrt[1 + (h1[y])^2], {y, 0, 3.79129}]
- A2 = Integrate[2*Pi*k[y]*Sqrt[1 + (k1[y])^2], {y, 0, 3.79129}]
- A3 =Integrate[2*Pi*p[y]*Sqrt[1 + (p1[y])^2], {y, 0, 3.79129}]
- A = A2 - A1 (*area of revolving region around y-axis*)
- *************************************
- Integral convergent,divergent?
- L1 = Limit[Integrate[x*E^(-x^2),{x, a, 0}],a -> -Infinity]
- L2 = Limit[Integrate[x*E^(-x^2),{x, 0, b}],b -> Infinity]
- (*both integrals converge, so does the whole integral *)
- L = L1 + L2 (*the integral converges to zero*)
- Plot[x*E^(-x^2), {x, -10, 10}, PlotRange -> All]
- ******************************************
- approximate area, Riemann, rectangles,graph, correct area with integral and error
- f[x_] = x*Log[x + 1];
- deltax = (5 - 1)/15; (b-a/n)
- priblizna = Sum[f[1 + (i - 1/2)*deltax]*deltax, {i, 1, 15}] // N
- tabela = Table[
- Rectangle[{1 + (i - 1)*deltax, 0}, {1 + i*deltax,
- f[1 + (i - 1/2)*deltax]}], {i, 1, 15}];
- grafik = Plot[f[x], {x, 0, 5}]
- Show[Graphics[tabela], grafik]
- tocna=Integrate[f[x], {x, 1, 5}] // N
- error=priblizna-tocna
- *******************************
- find value of integral using definite integral, limit value of rieman sum
- f[x_] = x^2 + x - 1;
- Integrate[f[x], {x, -1, 3}]
- a[n_]=Sum[f[-1 + i*4/n]*4/n,{i,1,n}]
- Limit[a[n], n -> Infinity] // N
- L=koren od dy/dt ^2 + dx/dt^2
- L(plane curve)=Integrate[sqrt[1+(dx/dy)^2],{y,c,d}]
- S=Integrate[2*Pi*f[x]*sqrt[1+(dx/dy)^2],{x,a,b}] (*area of solid*)
- V=Integrate[Pi*(f[x]^2 - g[x]^2), {x,a,b} (* Volume discs around x-axis *)
- V=Integrate[2*Pi*x*(f[x] - g[x]), {x,a,b} (* Volume shells around y-axis *)
- x=rcost; y=rsint; r^2=x^2+y^2; tgt=y/x
- D>0: fxx>0 = min, fxx<0 = max ; D<0: saddle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement