Tanya Salyers University of Notre Dame MATH10560: Calculus II, Summer 2007 Using Maple for Calculus II restart: Our text has mentioned that computer programs can be used to do integrals. This worksheet is intended to give you enough of an introduction to Maple to be able to check your homework solutions.
<Text-field style="_cstyle5" layout="_pstyle14">Indefinite integrals</Text-field> We look first at indefinite integrals. The syntax for finding the indefinite integral with respect to x of the function y=f(x) is: int(f(x), x); Notice that Maple statements end with a semicolon. To try a few examples, put the cursor in the red input section below and hit enter. int(x,x); int(sin(x), x); int(y^3 + y^2 - 3*y + 5, y); int(sin(x),y); int(f(x),x); If you use a capital "I" then Maple repeats your integral, and to evaluate it you use the "value" command (see below). This is useful because you can proof-read to make sure you entered what you intended to enter. Int(sin(x),x); value(%); If we use a captial "I" in "Int" then Maple will repeat the problem to us. It's a nice-way to double-check that you really typed what you intended to type. Then you can use "value(%)" to find the antiderivative. The assign function := my_integrand:=exp(2*x); Int(my_integrand,x); my_answer:=value(%); my_answer;
<Text-field style="_cstyle5" layout="_pstyle14">Differentiation: Checking your work</Text-field> Since Maple has been finding an antiderivative, it seems worthwhile to have Maple check its work by doing differentiation. The syntax to take the derivative of f(x) with respect to x is: diff(f(x), x); It is instructive to look at some examples: diff(sin(x),x); diff(sin(y), x); diff(z^3 + 2*z^2 + 5*z + 7, z); diff(arctan(x),x); diff(ln(x),x); diff(f(x),x); diff(int(f(x),x),x); int(diff(f(x),x),x); Some things to notice from the examples above: 1) Once again, we can use any variable to differentiate with respect to. (Compare examples 1 and 3.) 2) If we are differentiating with respect to x, then y is considered a constant. (Example 2) 3) If we have not defined f(x), then its derivative is simply, the derivative of f(x). (Example 6.) 4) Even with undefined functions, Maple correctly applies the fundamental theorem of calculus. (Examples 7 and 8.) It is worthwhile to note what happens if we differentiate something we have integrated.. int(sin(x), x); diff(int(sin(x), x),x); int(y^3 + y^2 - 3*y + 5, y); diff(int(y^3 + y^2 - 3*y + 5, y),y); Sometimes we need to do some work to see that this gets us back to where we started. int(1/(4-x^2),x); diff(int(1/(4-x^2),x),x);simplify(%);
<Text-field style="_cstyle5" layout="_pstyle14">The definite integral</Text-field>
<Text-field style="_cstyle5" layout="_pstyle14">Additional useful commands</Text-field> This section contains a few additional commands that you may find useful: defining a function, plotting and solving equations. f:=x->x^2; plot(f(x),x=-5..5); with(plots):implicitplot(f(x)+y^2=4,x=-4..4,y=-4..4); solve(f(x)=4,x);