Numerical integration - Your turn#

Part (a)#

Compute the following integral analytically:

\[ \int_0^2 x^2 + \dfrac{1}{(x + 1)^2}\ \mathrm{d}x \]

TODO: Write your answer below#

You may find it helpful to refer to the demo for LaTeX tips, though you can also write out your steps on paper. Showing more steps is always helpful, e.g., the indefinite integral.

Part (b)#

Compute the same integral numerically using the trapezoid(y, x) command. Use an increment of \(0.01\).

Tip

Note that your domain should include both endpoints!

# TODO: Write your solution below

Part (c)#

Repeat part (b), this time with an increment of \(0.2\). What is your conclusion?

# TODO: Write your solution below

TODO: Write your answer in the space below#

Exporting your work#

When you’re ready, the easiest way to export the notebook is to File > Print it and save it as a PDF. Remove any excessively long, unrelated outputs first by clicking the arrow → next to the output box and then Show/hide output. Obviously don’t obscure any necessary output or graphs!