MATH 156 LAB 6Topic 1: Calculating NiMlI1BpRw==.We have seen that NiMvJSNQaUciIiM=NiMtJSRpbnRHNiQtJSVzcXJ0RzYjLCYiIiJGKiokJSJ4RyIiIyEiIi9GLDssJEYqRi5GKg==. This is because the integral represents the area of a semicircle of radius 1. The circle has area NiMlI1BpRw==.In this lab you will compute the first 6 digits of NiMlI3BpRw== using this integral.Graph the fucntion NiMvLSUiZkc2IyUieEctJSVzcXJ0RzYjLCYiIiJGLCokRiciIiMhIiI= on the range [NiMsJCIiIiEiIg==, NiMiIiI=].Notice that we have to use scaling=constrained, which has the effect that the NiMlInhH-axis and the NiMlInlH-axis have the same scale.As you see the function NiMtJSJmRzYjJSJ4Rw== is increasing on [NiMsJCIiIiEiIg==, 0] and decreasing on [0, 1].Compute the left-hand sums and right-hand sums with 10, 100, 1000 subintervals. Do not forget the student package.What do you notice? Can you explain what you noticed? You may want to graph some left-hand sums and right-hand sums to explain your answer.As a result we do not get underestimates and overestimates for NiMlI1BpRw== using the previous commands.Find underestimates and overestimates for NiMlI1BpRw==, using left-hand sums and right-hand sums with 5, 50, 500, 5000 on the intervals [-1,0] and [0,1].We can actually predict beforehand how large NiMlIm5H should be so that our underestimates and overestimates are within, say, NiMlKGVwc2lsb25H. Recall that on the interval [NiMlImFH, NiMlImJH] the difference |LHS(NiMlIm5H)-RHS(NiMlIm5H)|=|f(b)-f(a)|NiMlJkRlbHRhRw==NiMlInhH for a monotone function. If we split [-1,0] into NiMlIm5H subintervals the error is less than NiMvKiYsJi0lImZHNiMiIiEiIiItRic2IywkRiohIiJGLkYqJSJuR0YuKiZGKkYqRi9GLg== , since NiMlJkRlbHRhRw==NiMlInhH=(b-a)/NiMlIm5H. On the interval [0,1], if we split into NiMlIm5H subintervals, we have an error less than NiMvKiYsJi0lImZHNiMiIiEiIiItRic2I0YqISIiRiolIm5HRi0qJkYqRipGLkYt. So in the whole interval [-1,1] the error is less than NiMqJiIiIyIiIiUibkchIiI= and, since NiMlI1BpRw== is twice the integral, the error in estimating NiMlI1BpRw== is less than NiMqJiIiJSIiIiUibkchIiI= . If we want the error to be, say less than 0.001, we need to make NiMyKiYiIiUiIiIlIm5HISIiLSUmRmxvYXRHNiRGJiEiJA==, which gives NiMyKiYiIiUiIiItJSZGbG9hdEc2JEYmISIkISIiJSJuRw==, i.e., n>4000. This explains why with 5000 subintervals we had gotten the first 3 decimals correct.4/0.001;How large do you need to take NiMlIm5H, so that you can compute NiMlI1BpRw== with an error less than 0.0000001?Unfortunately, this number of subintervals is too large to work out with Maple. So we resort to the trapezoid rule and the midpoint rule.Compute TRAP(NiMlIm5H), MID(NiMlIm5H), with NiMlIm5H=10, 100, 1000 on the whole interval [-1,1]. Which ones give underestimates and which ones give overestimates of NiMlI1BpRw==? Why? What is the relation of TRAP(NiMlIm5H) with LHS(NiMlIm5H)?To compute more accurately, we can use Simpson's rule: SIM(NiMlIm5H)= NiMqJiwmLSUlVFJBUEc2IyUibkciIiIqJiIiI0YpLSUkTUlER0YnRilGKUYpIiIkISIi . There is a Maple command for Simpson's rule:simpson(f(x), x=lowerlimit..upperlimit, 2*number of subintervals)Compute NiMlI1BpRw== using Simpson's rule with NiMlIm5H=10, 100, 1000,10000 subintervals. Verify your answers using the formula for Simpson's rule.Topic 2: Substitutions with Maple.All the integrals in this section can be evaluated by hand. Although Maple can help us verify our answers, you should still learn the substitution method. You are encouraged to evaluate the integrals by hand, as a test of your understanding.Let us introduce the integral NiMtJSRpbnRHNiQqJiwmKiQlInhHIiIjIiIiRitGKyIiJUYpRitGKQ==: The command is Int(f(x), x)E1:=Int((x^2+1)^4*x, x);If we know which variable to change, we introduce the substitution NiMvJSJ1Ry0lImdHNiMlInhH the following way: changevar(u=g(x), E1,u). This substitutes NiMlInVH for NiMtJSJnRzYjJSJ4Rw== in the integral E1.E2:=changevar(u=x^2+1, E1, u);To compute this integral we can use the value command:E3:=value(E2);Notice that Maple does not include constants of integration. We always want to switch to the original variable NiMlInhH. This is done with the subs command. E4:=subs(u=x^2+1, E3);We do not need to do all these substitutions and changes, we can ask Maple to evaluate the integral E1 directly:value(E1);The problem is that this answer does not seem to be the same as the one we got before. The reason is that we need to expand NiMqJCwmKiQlInhHIiIjIiIiRihGKCIiJg==.expand(E4, x);We still notice that there is a difference: the constant NiMqJiIiIkYkIiM1ISIi. This is so, because in integration Maple does not care about constants. The most general antiderivative is any of the previous expressions +C.One problem is that Maple does not tell us which substitution to use. So the choice is ours and this is where our work lies.Try to substitute NiMvJSJ1RywmKiQlInhHIiIjIiIiRilGKQ== in the integral NiMtJSRpbnRHNiQqJCwmKiQlInhHIiIjIiIiRitGKyIiJUYp. What do you notice?In fact one does not need substitution in this integral to compute it. We can expand the integrand:g:=expand((x^2+1)^4, x);V2:=Int(g, x);V3:=value(V2);value(Int((x^2+1)^4, x));The last command verified our previous answer. Evaluate the integral NiMtJSRpbnRHNiQqKiUkY29zRyIiIyUieEciIiIlJHNpbkdGKkYpRipGKQ== using a substitution. Check your answer with the value command.Evaluate the integral NiMtJSRpbnRHNiQqJiklImVHLCQlInhHISIiIiIiLSUkdGFuRzYjRidGLEYq using a substitution. Check your answer with the value command.