(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 14079, 328]*) (*NotebookOutlinePosition[ 14760, 351]*) (* CellTagsIndexPosition[ 14716, 347]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["No\[CCedilla]\[OTilde]es de calculo integral.", "Title", FontFamily->"Courier New"], Cell[BoxData[ \(By\ Thales\ Fernandes\)], "Program"], Cell[CellGroupData[{ Cell["O que \[EAcute] integral?", "Subtitle", FontFamily->"Courier New"], Cell["\<\ Temos, por exemplo, um grafico, como seno de x, no intervalo fechado \ [0,\[Pi]] e nos queremos saber qual \[EAcute] a area desse grafico. Podemos \ fazer da seguinte maneira. Eu uso um metodo semelhando a Soma de Riemann, mas ao envez de usar \ quadrados, uso trapezios, deste modo \[EAcute] muito mais preciso\ \>", "Text", FontFamily->"Courier New"], Cell[BoxData[{ \(Clear[f, i, a, b, g0, g2, ret]\), "\n", \(f[x_] := Sin[x]\), "\n", \(\(i = 4;\)\), "\n", \(\(a = 0;\)\), "\n", \(\(b = \[Pi];\)\), "\n", \(\(g0 = Plot[f[x], {x, a, b}, DisplayFunction \[Rule] Identity];\)\), "\n", \(\(Show[Graphics[Line[{{a, 0}, {b, 0}}]], Graphics[ Table[Line[{{n, \(-0.5\)}, {n, 1.5}}], {n, a, b, \(b - a\)\/i}]], g0];\)\)}], "Input", FontFamily->"Courier New"], Cell[TextData[{ "Assim, feita essa parte devemos ligar os pontos desse intervalo da \ seguinte maneira para se formar um poligono, um trapezio.\n{", Cell[BoxData[ \({n, \ 0}\ , {n, f[n]}, \ {\(\(\(b - a\)\/i\)\(+\)\(n\)\(\ \)\), \ f[\(b - a\)\/i + n\ ]}\ , \ {\(\(\(b - a\)\/i\)\(+\)\(n\)\(\ \)\), 0}\)]], "}\nVou explicar essa tabela.\nPegamos um ponto n dentro do intervalo \ [a,b]. Devemos pegar uma linha partindo do ponto n, no deixo x, ou seja, \ altura 0. Essa linha ira ate o ponto de f[n], a imagem. sera a altura do \ grafico no ponto n. Ligamos essa altura ate a outra altura, no ponto n + ", Cell[BoxData[ \(TraditionalForm\`\(b - a\)\/i\)]], " , pois ", Cell[BoxData[ \(TraditionalForm\`\(b - a\)\/i\)]], " sera quanto valera cada divis\[ATilde]o do grafico em n+1 partes. Assim \ fazendo o mesmo processo porem inverso, da algura no ponto n + ", Cell[BoxData[ \(TraditionalForm\`\(b - a\)\/i\)]], " ate o eixo x no mesmo ponto. Como resultado tempos isso:" }], "Text", FontFamily->"Courier New"], Cell[BoxData[{ \(Clear[f, i, a, b, g0, g2, ret]\), "\n", \(f[x_] := Sin[x]\), "\n", \(\(i = 4;\)\), "\n", \(\(a = 0;\)\), "\n", \(\(b = \[Pi];\)\), "\n", \(\(g2 = Plot[f[x], {x, a, b}, DisplayFunction \[Rule] Identity];\)\), "\n", \(\(ret = Table[{{n, 0}, {n, f[n]}, {\(b - a\)\/i + n, f[\(b - a\)\/i + n]}, {\(b - a\)\/i + n, 0}}, {n, a, b - \(b - a\)\/i, \(b - a\)\/i}];\)\), "\n", \(\(Show[ Graphics[ Table[Line[{{n, \(-0.1\)}, {n, 1.1}}], {n, a, b, \(b - a\)\/i}]], Graphics[ Table[{Polygon[ret\[LeftDoubleBracket]u\[RightDoubleBracket]]}, {u, 1, Length[ret]}]], g2, DisplayFunction \[Rule] $DisplayFunction];\)\), "\n", \(N[\[Integral]\_a\%b f[x] \[DifferentialD]x, 50]\), "\n", \(N[\[Sum]\+\(n = 1\)\%\(Length[ret]\)1\/2\ \((\((ret\[LeftDoubleBracket] n, 2, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 2\[RightDoubleBracket])\) + \((ret\[LeftDoubleBracket]n, 3, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 4, 2\[RightDoubleBracket])\))\)\ \((ret\[LeftDoubleBracket] n, 3, 1\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 1\[RightDoubleBracket])\), 50]\)}], "Input", FontFamily->"Courier New"], Cell[TextData[{ "ret ira formar uma tabela variando o valor de n no intervalo de [a,b] com \ um intervalo de ", Cell[BoxData[ \(TraditionalForm\`\(b - a\)\/i\)]], ". isso ira fazer o grafico, mas nos queremos saber o valor da area do \ grafico. Devemos entao calcular o somatorio da area de cada trapezio.\nA area \ do trapezio \[EAcute] dada por ", Cell[BoxData[ \(TraditionalForm\`\((B + b)\)\ h\/2\)]], " . Onde B eh o maior lado, b o menor lado, e h a altura do trapezio. Para \ quem n\[ATilde]o sabe como se deduz essa formula explicarei.\nTemos por \ exemplo o trapezio asseguir." }], "Text", FontFamily->"Courier New"], Cell[BoxData[ \(Show[Graphics[Polygon[{{0, 0}, {1, 0}, {1, 2}, {0, 1}}]]]; \)], "Input",\ FontFamily->"Courier New"], Cell["\<\ A altura do poligono que usaremos \[EAcute] a altura q se encontra paralela \ ao eixo x. Apenas para ficar mais facil entender o grafico acima. Pela tabela {{0,0},{1,0},{1,2},{0,1}} vemos q a altura \[EAcute] a varia\ \[CCedilla]\[ATilde]o do eixo x. ou seja. 1-0 = 1. O lado B, maior lado \ possui tamanho de 2-0 = 2 e o menor lado 1-0 = 1. Podemos fazer o seguinte com esse poligono.\ \>", "Text", FontFamily->"Courier New"], Cell[BoxData[ \(Show[ Graphics[{{Hue[0.2], Polygon[{{0, 1}, {1, 2}, {1, 3}, {0, 3}}]}, {Hue[0.3], Polygon[{{0, 0}, {1, 0}, {1, 2}, {0, 1}}]}, Text[StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 14, FontWeight \[Rule] "\"], {1.02, 2.5}], Text[ StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 14, FontWeight \[Rule] "\"], {1.02, 1.0}], Text[ StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 14, FontWeight \[Rule] "\"], {\(-0.02\), 2.0}], Text[StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 14, FontWeight \[Rule] "\"], {\(-0.02\), 0.45}], Text[StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 14, FontWeight \[Rule] "\"], {0.5, 2.80}], Text[ StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 14, FontWeight \[Rule] "\"], {0.5, \(-0.18\)}]}]]; \)], \ "Input", FontFamily->"Courier New"], Cell[BoxData[{ \(Os\ dois\ trapezios\ sao\ identicos . Para\ calcular\ a\ area\ de\ um\ trapezio\ calculamos\ a\ area\ \ desse\ quadrado\ e\ dividimos\ por\ dois . Area\ trapezio = 1\/2\ \((b + B)\)\ h\), "\n", \(Entaoparacalcularaareadonossograficodevemosfazeromesmoprocessousandoatab\ ela jaconhecida . \ {{n, 0}, {n, f[n]}, {\(b - a\)\/i + n, f[\(b - a\)\/i + n]}, {\(b - a\)\/i + n, 0}} . \n Onde\ b\ = \ \(f[n]\ - \ 0\ = \ ret\[LeftDoubleBracket]n, 2, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 2\[RightDoubleBracket]\)\), "\n", \(B\ = \ \(f[\(b - a\)\/i + n\ ]\ - \ 0\ = \ ret\[LeftDoubleBracket]n, 3, 2\[RightDoubleBracket] - \ ret\[LeftDoubleBracket]n, 4, 2\[RightDoubleBracket]\)\), "\n", \(e\ \ h\ = \ \(\(b - a\)\/i + n\ \ - \ n\ \ = \ \(\(b - a\)\/i\ = \ ret\[LeftDoubleBracket]n, 3, 1\[RightDoubleBracket] - \ ret\[LeftDoubleBracket]n, 1, 1\[RightDoubleBracket]\)\)\), "\n", \(Aviso : \ N\[ATilde]o\ confuda\ esse\ b\ de\ lado\ menor\ com\ b\ do\ intervalo\ [ a, b]\), "\n", \(Substituindo\ na\ formula\ anterior\ temos . \ \ \n\(1\/2\)\ \((\((ret\ \[LeftDoubleBracket]n, 2, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 2\[RightDoubleBracket])\) + \((ret\[LeftDoubleBracket]n, 3, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 4, 2\[RightDoubleBracket])\))\)\ \((ret\[LeftDoubleBracket]n, 3, 1\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 1\[RightDoubleBracket])\)\), "\n", \(UtilizandooSomatorioparapodersomartodososvaloresdequenpodeassumirno intervalo[a, b] com parti\[CCedilla]\[OTilde]es em pequenos intervalos de n + 1 temos . \(\[Sum]\+\(n = 1\)\%\(Length[ret]\)\(1\/2\) \((\((\((ret\ \[LeftDoubleBracket]n, 2, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 2\[RightDoubleBracket])\) + \((ret\ \[LeftDoubleBracket]n, 3, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 4, 2\[RightDoubleBracket])\))\) \((ret\ \[LeftDoubleBracket]n, 3, 1\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 1\[RightDoubleBracket])\))\)\)\), "\n", \(Length[ret] nos da quantos termos tem ret . quando maior o valor de i, maior sera a aproxima\[CCedilla]\[ATilde]o com a \(\[Integral]f[x] \[DifferentialD]x\)\), "\n", \(Rodando novamente para um valor de i maior temos q o resultado se aproxima cada vez \( \(maisde2\)\(.\)\)\)}], "Text", FontFamily->"Courier New"], Cell[BoxData[{ \(Clear[f, i, a, b, g0, g2, ret]\), "\n", \(f[x_] := 1 + x^4 - 3 x^2\), "\n", \(\(i = 12;\)\), "\n", \(\(a = \(-1\);\)\), "\n", \(\(b = 1.9;\)\), "\n", \(\(g2 = Plot[f[x], {x, a, b}, DisplayFunction \[Rule] Identity];\)\), "\n", \(\(ret = Table[{{n, 0}, {n, f[n]}, {\(b - a\)\/i + n, f[\(b - a\)\/i + n]}, {\(b - a\)\/i + n, 0}}, {n, a, b - \(b - a\)\/i, \(b - a\)\/i}];\)\), "\n", \(\(Show[ Graphics[ Table[{Polygon[ret\[LeftDoubleBracket]u\[RightDoubleBracket]]}, {u, 1, Length[ret]}]], g2, DisplayFunction \[Rule] $DisplayFunction];\)\), "\n", \(N[\[Integral]\_a\%b f[x] \[DifferentialD]x, 50]\), "\n", \(N[\[Sum]\+\(n = 1\)\%\(Length[ret]\)1\/2\ \((\((ret\[LeftDoubleBracket] n, 2, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 2\[RightDoubleBracket])\) + \((ret\[LeftDoubleBracket]n, 3, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 4, 2\[RightDoubleBracket])\))\)\ \((ret\[LeftDoubleBracket] n, 3, 1\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 1\[RightDoubleBracket])\), 50]\)}], "Input", FontFamily->"Courier New"], Cell["\<\ Essa ultima equa\[CCedilla]ao nos fazmos o seguinte, nao deixamos i \ constante. variamos ele criando uma tabela. mesmo esquemo que os de cima, mas \ com o i variando.\ \>", "Text"], Cell[BoxData[{ \(Clear[f, i, a, b, g0, g2, ret]\), "\n", \(Off[Table::"\", NIntegrate::"\"]\), "\n", \(f[x_] := \[ExponentialE]\^Cos[x]\), "\n", \(a = 0; \), "\n", \(b = 20; \), "\n", \(g2 = Plot[f[x], {x, a, b}, DisplayFunction \[Rule] Identity]; \), "\n", \(ret = Table[{{n, 0}, {n, f[n]}, {\(b - a\)\/i + n, f[\(b - a\)\/i + n]}, {\(b - a\)\/i + n, 0}}, {n, a, b - \(b - a\)\/i, \(b - a\)\/i}]; \), "\n", \(Table[ Show[Graphics[ Table[{Polygon[ret\[LeftDoubleBracket]u\[RightDoubleBracket]]}, {u, 1, Length[ret]}]], g2, DisplayFunction \[Rule] $DisplayFunction], {i, 2, 40}]; \), "\n", \(Clear[i]\), "\n", \(TableForm[ Table[{i, ret = Table[{{n, 0}, {n, f[n]}, {\(b - a\)\/i + n, f[\(b - a\)\/i + n]}, {\(b - a\)\/i + n, 0}}, {n, a, b - \(b - a\)\/i, \(b - a\)\/i}]; N[\[Sum]\+\(n = 1\)\%i 1\/2\ \((\((ret\[LeftDoubleBracket]n, 2, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 2\[RightDoubleBracket])\) + \((ret\ \[LeftDoubleBracket]n, 3, 2\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 4, 2\[RightDoubleBracket])\))\)\ \((ret\ \[LeftDoubleBracket]n, 3, 1\[RightDoubleBracket] - ret\[LeftDoubleBracket]n, 1, 1\[RightDoubleBracket])\), 50]}, {i, 2, 40}]]\), "\n", \(N[\[Integral]\_a\%b f[x] \[DifferentialD]x, 50]\)}], "Input", FontFamily->"Courier New"], Cell[BoxData[ \(Essa\ ultima\ tabela\ nos\ da\ o\ valor\ aproximado\ da\ area\ do\ \ grafico . quando\ maior\ o\ i\ maior\ a\ precisao\)], "Text"] }, Open ]] }, Open ]] }, FrontEndVersion->"5.2 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 677}}, WindowSize->{815, 541}, WindowMargins->{{69, Automatic}, {Automatic, 24}}, TaggingRules:>{"Salvaged" -> True} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 91, 1, 93, "Title"], Cell[1870, 56, 56, 1, 42, "Program"], Cell[CellGroupData[{ Cell[1951, 61, 74, 1, 51, "Subtitle"], Cell[2028, 64, 365, 7, 90, "Text"], Cell[2396, 73, 470, 12, 184, "Input"], Cell[2869, 87, 1072, 22, 194, "Text"], Cell[3944, 111, 1437, 30, 322, "Input"], Cell[5384, 143, 651, 14, 134, "Text"], Cell[6038, 159, 123, 3, 30, "Input"], Cell[6164, 164, 439, 8, 109, "Text"], Cell[6606, 174, 1249, 24, 190, "Input"], Cell[7858, 200, 2839, 48, 413, "Text"], Cell[10700, 250, 1356, 28, 307, "Input"], Cell[12059, 280, 191, 4, 52, "Text"], Cell[12253, 286, 1645, 34, 399, "Input"], Cell[13901, 322, 150, 2, 31, "Text"] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)