# Shortcuts for integration and differentiation?

I am trying to learn the most useful keyboard shortcuts for doing basic operations such as integration, differentiation etc in standard form. A few questions -

1. I have checked the documentation and i found shortcuts such as Esc[intt]Esc for an integral and Esc[dintt]Esc for definite integral in standard mathematical form but i can't find a short cut for a standard derivative i.e d/dx ? I am aware you can use D[] function but i would like to be able to input in standard mathematical form. Esc[dt]Esc gives me a partial derivative but i just want standard d/dx for single variable calculus.

2. If i enter a indefinite integral and i want to change this into a definite integral is there anyway i can add the upper and lower limits or do i need to re-enter the whole integral using Esc[dintt]Esc ?

Thanks David.

• esc-dd-esc x for the infinitesimal $d x$. For simple derivatives, use '. For example: Sin'[x]. However, I would strongly urge you to not use such typesetting shortcuts for programming purposes. They're ok for text/taking notes, etc., but I don't think it improves your speed of programming or ease of understanding the code. It certainly does make bugs and misplaced boxes hard to find/fix... – rm -rf Feb 3 '13 at 17:28
• I can enter d/dx using the maths palette but i can't find a shortcut for this. There is a shortcut for partial derivative. – David McHarg Feb 3 '13 at 17:28
• ah i see. You need to actually use esc-dd-esc and enter the top line then you need to use control-/ to enter the bottom line and use esc-dd-again. – David McHarg Feb 3 '13 at 17:32
• rm-rf thanks. For programming i don't use this its more for elementary demos so i can use a notation people are familiar with. – David McHarg Feb 3 '13 at 17:34
• As for changing an indefinite integral to definite, you just need to add the sub/super scripts with ctrl-_ for subscript and then ctrl-5 for the superscript at the same level. (usual ctrl-6 won't work) – rm -rf Feb 3 '13 at 17:36

If you're really used to traditional math notation, you can also enter and evaluate your derivatives and integrals in TraditionalForm. I'll illustrate this without assuming any special stylesheet settings, starting from a default notebook (this is the version 8 default, not version 9 which I dislike). It's a step-by step walkthrough, so I'll use screen shots and menu commands instead of keyboard shortcuts (the latter make it much more streamlined but harder to explain):

Let's say you want to know the derivative of $\cos(x)$.

• Start a new numbered display equation (Format > Style > DisplayFormulaNumbered)

• Convert the cell to TraditionalForm (Cell > Convert To > TraditionalForm)

• The Null can be highlighted and overwritten with our intended derivative, using EscpdEsc for the $\partial$ symbol, and the traditional notation for $\sin(x)$ with lower case and round parentheses:

• Make a fraction by highlighting the numerator and pressing Ctrl-/, followed by the denominator:

• Now to evaluate this completely traditional looking input, highlight it and select the menu item Evaluation > Evaluate in Place:

• The result is this:

Similarly, you can enter integrals by doing this:

where I entered the differential as EscddEsc and the integral as EscintEsc.

Some people prefer to set up style sheets in which the TraditionalForm setting for displayed equations is already pre-defined, but I wanted to use the bare-bones starting point.

Edit: Programming with TraditionalForm

While I'm discussing "natural" math input, it may be worth mentioning that you can combine the above formatting with standard input format, too.

Usually, the following won't work at all:

However, if I input the function body in a TraditionalForm equation as shown above and then copy it into the function, it gets wrapped by a FormBox which is invisible but makes the following evaluatable:

OK, with the mix of brackets, this looks very wrong from a programming perspective, but I could imagine situations where this is preferable because of its "natural" readability. Here is the proof that it works:

dOperator[Sin[x]]

(* ==> Cos[x] Sin[x] *)


To create a FormBox in an Input cell to allow you to enter TraditionalForm math, a quick way is to type a single letter, highlight it and press Shift-Cmd-T. Then replace the letter with the desired formula.