Integration Exercises You will submit 2 reports for this lab. - Group Lab report 1, with answers to assignments 1 and 2 and - Discovery Report 1, with your answers on the Discover Project “Patterns in Integrals.” Always make sure your final report is self-contained and well-written and stored in a single pdf file. Assignment 1: Calculating Antiderivatives Exactly and Approximately (6pts) 1) Use Mathematica to compute the exact antiderivatives for the following functions a) (0.5pt) y(x) = x sin x I n [ ] : = Integrate [x Sin[x], x] O u t [ ] = - x Cos[x] + Sin[x] b) (0.5 pts) y ( x ) = I n [ ] : = Integrate arctan x x 2 +1 ArcTan[x] x2 + 1 , x O u t [ ] = ArcTan[x]2 2 2. Use the code from the Lab 3 -- Discussion file to estimate numerically the value of the definite inte2 x gral ∫1 arctan x using n=50 through the: x 2 +1 i) (1 pts) Left Hand and Right Hand Rule (you’ll have to code one of these) ii) (0.5pt) Trapezoidal Rule iii) (0.5pt) Simpson’s Rule iv) (0.5pt) Monte Carlo v) (2.5 pts) Midpoint Rule. You will have to code this one yourself. See section 7.7 for the theorem to use, and use the code for one of other five rules as a starting point. Left Hand Rule i) Printed by Wolfram Mathematica Student Edition 2 Calc Lab 3.nb I n [ ] : = Clear[x] f[x_] := ArcTan[x] x2 + 1 a = 1 ; b = 2 ; n = 50 ; h = (b - a) / n; sum = 0; Do[sum = sum + f[a + (i - 1) * h] * h, {i, 1, n}] N[sum] O u t [ ] = 0.306177 Right Hand Rule i) I n [ ] : = Clear[x] f[x_] := ArcTan[x] x2 + 1 a = 1; b = 2; n = 50; h = (b - a) / n; sum = 0; Do[sum = sum + f[a - (i - 1) * h] * h, {i, 1, n}] N[sum] O u t [ ] = 0.312314 Trapezoidal Rule ii) I n [ ] : = Clear[x] f[x_] := ArcTan[x] x2 + 1 a = 1; b = 2; n = 50; h = (b - a) / n; sum = (f[a] + f[b]) * h / 2; Do[sum = sum + f[a + i * h] * h, {i, 1, n - 1}] N[sum] O u t [ ] = 0.304464 Simpson’s Rule iii) I n [ ] : = f[x_] := ArcTan[x] x2 + 1 a = 1; b = 2; n = 50; h = (b - a) / n; sum = (f[a] + f[b]) * h / 3; Do[sum = sum + f[a + (2 * i - 1) * h] * (4 * h / 3), {i, 1, n / 2}] Do[sum = sum + f[a + 2 * i * h] * (2 * h / 3), {i, 1, n / 2 - 1}] N[sum] O u t [ ] = 0.304464 Monte Carlo iv) Printed by Wolfram Mathematica Student Edition Calc Lab 3.nb Clear[x] ArcTan[x] f[x_] := x2 + 1 a = 1; b = 2; n = 50; sum = 0; Do[random = RandomReal[{a, b}]; sum = sum + f[random], {i, 0, n - 1}] sum = sum * (b - a) / n; N[sum] O u t [ ] = 0.301441 Midpoint Rule v) I n [ ] : = Clear [x] f[x_] := ArcTan[x] x2 + 1 a = 1; b = 2; n = 50; sum = 0; h = (b - a) / n; Do[sum = sum + h * f[((a + (i - 1) * h) + (a + i * h)) / 2], {i, 1, n}] N[sum] N[Integrate[f[x], {x, a, b}]] O u t [ ] = 0.304464 O u t [ ] = 0.304464 Assignment 2: Construct or Uncover an Example of a function that Mathematica cannot integrate but you can do analytically. (4pts+1pt extra credit) The function here is an example of such a function: y(x) = 1+ x +2 x x +Log[ x ] 2 x x +Log[ x ]+ x x +Log[ x ] 1. (1pt) Check that this integrand is equal to the derivative of log x + x + log x by hand, by first applying the chain rule and then performing the necessary algebraic calculations. The chain rule application can also be seen below: Printed by Wolfram Mathematica Student Edition 3 4 Calc Lab 3.nb I n [ ] : = DLogx + x + Log[x] , x We show here that indeed Mathematica cannot figure out how to calculate this integral. 1+x+2x I n [ ] : = x + Log[x] x x + Log[x] 2 x x + Log[x] + x O u t [ ] = 1+x+2x 1 2 x + Log[x] x x x + Log[x] + x x + Log[x] 2. (2pt) Help Mathematica by first rewriting y(x) as 1+ x+ 1+ 2 1 x x+Log[x] x+Log[x] function to be integrated. 1+ I n [ ] : = y[x_] := x+ 1+ 2 Functionx, 1+ 2 1 x x+Log[x] x+ 1+ I n [ ] : = x x+Log[x] x + Log[x] 1+ I n [ ] : = 1 Functionx, x + Log[x] 1+ 2 1 x x+Log[x] x+ x + Log[x] Integrate[y[x], x] O u t [ ] = 1+ Functionx, 1+ 2 1 x x+Log[x] x+ x + Log[x] O u t [ ] = Logx + x + Log[x] I n [ ] : = D[Log[x + Sqrt[x + Log[x]]], x » D[Log[x + Sqrt[x + Log[x]]], x] O u t [ ] = 1+ x+ 1+ 2 1 x x+Log[x] x + Log[x] Printed by Wolfram Mathematica Student Edition (show this) , and then asking for this Calc Lab 3.nb I n [ ] : = Integrate f (x)=(1 + (1 + 1/x)/(2 Sqrt[x + Log[x]]))/(x + Sqrt » Integrate[(1 + (1 + 1 / x) / (2 * Sqrt[x + Log[x]])) / (x + Sqrt[x + Log[x]]), x] O u t [ ] = Logx + x + Log[x] 3. (1pt extra credit) Can you construct, or find, an additional example that Mathematica cannot calculate without help, but you can analytically? x I n [ ] : = x + Log[x] x x + Log[x] x x Discovery Project “Patterns in Integrals”: Discovering an Integration Formula (this will count as a written homework assignment and will be worth 10pts) Do the Discovery Project “Patterns in Integrals” from your textbook at the end of Section 7.6. You may use a scanned hand-written page, instead of typing up your answer, if you’d like, to present your proofs. You may omit problem 4d, as it requires a proof by induction, a proof method that we have not discussed in this course. Printed by Wolfram Mathematica Student Edition 5