2
$\begingroup$

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.

$\endgroup$
7
  • 1
    $\begingroup$ 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... $\endgroup$
    – rm -rf
    Commented Feb 3, 2013 at 17:28
  • $\begingroup$ 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. $\endgroup$ Commented Feb 3, 2013 at 17:28
  • $\begingroup$ 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. $\endgroup$ Commented Feb 3, 2013 at 17:32
  • $\begingroup$ 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. $\endgroup$ Commented Feb 3, 2013 at 17:34
  • $\begingroup$ 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) $\endgroup$
    – rm -rf
    Commented Feb 3, 2013 at 17:36

1 Answer 1

2
$\begingroup$

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)

1

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

2

  • 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:

3

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

4

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

5

  • The result is this:

6

Similarly, you can enter integrals by doing this:

7

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:

failed

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:

works

enter image description here

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.