This section describes how to symbolically evaluate definite and indefinite integrals, derivatives, and limits.

**Derivatives**

To evaluate a derivative symbolically, you can use Mathcad’s derivative operator and the live symbolic equal sign as shown in Figure 17-14:

• Type? to create the derivative operator or type [Ctrl]? to create the higher order derivative operator.

• In the placeholders, enter the expression you want to differentiate and the variable with respect to which you are differentiating.

• Press [Ctrl]. (the control key followed by a period). Mathcad displays an arrow, “→”.

• Press [Enter] to see the result.

Figure 17-15 shows you how to differentiate an expression without using the derivative operator. The Symbolics menu command Variable=>Differentiate differentiates an expression with respect to a selected variable. For example, to differentiate 2 . x2 + y with respect to x:

• Enter the expression.

• Click on the x.

• Choose Variable=> Differentiate from the Symbolics menu. Mathcad will display the derivative, 4 . x .

If you selected the variable y instead of x, you would get the answer 1. Mathcad treats all variables except the one you’ve selected as constants. If you’ve selected neither x nor y the menu command will be gray. Mathcad can’t differentiate the expression because you haven’t specified a differentiation variable.

If the expression in which you’ve selected a variable is one element of an array, Mathcad will differentiate only that array element. To differentiate an entire array, differentiate each element individually by selecting a variable in that element and choosing Variable⇒Differentiate from the Symbolics menu.

**Indefinite integrals**

Mathcad provides the symbolic indefinite integral operator shown in Figure l7-14. To use this operator:

• Type [Ctrl]I to insert the indefinite integral operator and its placeholders.

• Fill in the placeholder for the integrand.

• Place the integration variable in the placeholder next to the “d.” This can be any variable name.

• Press [Ctrl]. (the control key followed by a period). Mathcad displays an arrow, “→”.

• Press [Enter] to see the result.

Figure 17-15 shows how to integrate an expression without using the indefinite integral operator. The Symbolics menu command noninterchangeable integrates an expression with respect to a selected variable. For example, to integrate 2 . x2 + Y with respect

tox:

• Select the x.

• Choose Vartable⇒ lntegrate from the Symbolics menu. Mathcad will display the integral.

The Variable⇒ lntegrate command integrates an expression with respect to a selected variable. If you don’t have a variable selected, this command will be gray. Mathcad cannot integrate without knowing the variable of integration.

If the symbolic processor can’t find a closed-form indefinite integral, you’ll see an appropriate error message. Keep in mind that many simple expressions don’t have a closed-form indefinite integral that can be written in terms of polynomials or elementary functions. For example, e-x3 has no elementay integral. If the integral is too big to display, Mathcad puts the answer, in text form, on the clipboard. See the section ”Long answers” on page 395 to learn what to do when this happens.

When evaluating an indefinite integral, remember that the answer to an integration problem is not unique. If f(x) is an integral of a given function, so is f(x) + C for any constant C. Thus, the answer you get from Mathcad may differ by a constant from the answer you find in tables. If you differentiate a function and then integrate the result, you won’t necessarily get the original function back as your answer.

**Definite integrals**

To symbolically evaluate a definite integral:

• Type & to create the integral operator with its empty placeholders.

• Fill in the placeholders for the limits of integration. These can be variables, constants, or expressions.

• Fill in the placeholder for the integrand.

• Fill in the placeholder next to the “d.” This is the variable of integration.

• Press [Ctrl]. (the control key followed by a period). Mathcad displays an arrow, “→”.

• Press [Enter] to see the result.

The symbolic processor will attempt to find an indefinite integral of your integrand before substituting the limits you specified. See Figure 17-14 for an example. If the symbolic processor can’t find a closed form for the integral, you’ll see an appropriate error message.

If the symbolic integration succeeds and the limits of integration are integers, fractions, or exact constants like n, you’ll get an exact value for your integral. If the integrand or one of the limits contains a decimal point, the symbolic answer will be a number displayed with 20 significant digits. Use the float keyword described in “Floating point evaluation” on page 363 to generate a result with a different number of significant digits.

This answer will in general agree with the answer you get by evaluating the same integral numerically. The symbolic and numerical answers are, however, obtained in very different ways. Mathcad’s symbolic processor:

• Finds an indefinite integral.

• Subtracts its value at the lower limit of integration from its value at the upper limit.

The numerical integration routine, on the other hand:

• Samples the integrand at many points in the interval of integration.

• Uses these samples to approximate the integral.

The accuracy of this numerical integration depends on the value you set for the variable TOL and on the smoothness of the function you are integrating.

Of course, many functions do not have a closed form integral, and definite integrals involving these functions can only be calculated numerically. Integrals for which the integrand is not smooth (has a discontinuous derivative) might not be evaluated correctly by the symbolic processor. See the section “Integrals” for more on Mathcad’s numerical integration.

**Limits**

Mathcad provides three limit operators. These can only be evaluated symbolically.

They cannot be evaluated numerically. To use the limit operators:

• Press [Ctrl]L to create the limit operator. To create operators for limits from the left or right, press [Ctrl]B or [Ctrl]A.

• Enter the expression in the placeholder to the right of the “lim.”

• Enter the limiting variable in the left-hand placeholder below the “lim.”

• Enter the limiting value in the right-hand placeholder below the “lim.”

• Press [Ctrl]. (the control key followed by a period). Mathcad displays an arrow, “→”,

• Press [Enter] to see the result.

Mathcad will return a result for the limit. If the limit does not exist, Mathcad returns an error message. Figure 17-16 shows some examples of evaluating limits.