**Functions**

To typeset functions, we also use commands with parameters. Each of the following functions has at least one parameter, for the **argument **(the term on which the function operates).

Another pattern you may notice is that the command for a function generally resembles the name of the function.

**Roots**

**Roots**

Recall that a radical sign denotes the square root. To denote the *n*th root, we add a small *n *to the radical. We get these symbols with the following commands.

The square root of *x *is typeset with **\sqrt{x}**

The *n*th root of *x *is typeset with **\sqrt[n]{x}**

There are two important things to note.

First, the *n *in the *n*th root is enclosed with **square brackets **[] rather than curly braces. The curly braces are reserved for the argument of the root. (Generally, square brackets are used for optional parameters. This is the only time in this tutorial that we will encounter them.)

For example, trying to typeset the *n*th root of (*x *+ 1) with the code

\( \sqrt{n}{x+1} \)

places the *n* under the radical instead.

Second, everything that goes under the radical must go inside the curly braces.

So, trying again to typeset the *n*th root of (*x* + 1), this time with the code

\( \sqrt[n](x+1) \)

we get a radical sign with a small *n*, but the radical does not extend over the entire argument.

**Exercise 5.2.1**

**Exercise 5.2.1**

[1] Correct the code above to typeset the *n*th root of (*x *+ 1).

[2] Typeset the following expression:

**Solution 5.2.1**

**Solution 5.2.1**

[1] To typeset the expression correctly, the *n *must be placed in square brackets, and the argument, *x *+ 1, must be placed in curly braces:

\( \sqrt[n]{x+1} \)

[2] We obtain the radical symbol with the \sqrt command. We express the 3rd root by adding a 3 in square brackets to the command. Finally, we make the radical extend over the argument, *x *to the fifth, by placing x^{5} in curly braces.

\( \sqrt[3]{x^{5}} = x^{5/3} \)

When typing the exponent on the right-hand side, remember to use curly braces so that all three characters appear in superscript.

**Logarithms**

**Logarithms**

When writing a logarithmic expression, we must specify both the base and the argument.

The logarithm base *b *of *x *is typeset with **\log_{b}{x}**

The natural logarithm of *x *is typeset with **\ln{x}**

Let's go through the parts of this command.

First, note the **backslash **before "log." Compare the two versions in your document:

\( log{x} \) and \( \log{x} \)

In the first version, without the backslash, "log" is italicized. This is because the letters l, o, g in math mode are just read as variables. In the version with the backslash, only the actual variable *x *is italicized, and "log" appears in Roman type, spaced apart from the variable, to indicate that it is a function.

The **base **of a logarithm is added with a subscript. Characters are placed in subscript with an underscore, _. Just as with superscripts, we must use curly braces to group the characters. Otherwise, only the first character following the underscore appears in subscript.

Finally, the curly braces around the **argument **do not appear in the document. (In contrast with the radical sign, there is nothing in a logarithm that extends around the argument.) Thus, if your argument is a longer expression, consider using parentheses to make it clear to the reader.

**Exercise ****5.2****.****2**

**Exercise**

**5.2**

**.**

**2**

Typeset the logarithm base 12 of (*x *+ 1).

**Solution ****5.2****.2**

**Solution**

**5.2**

**.2**

The logarithmic expression is typeset with

\( \log_{12}{(x + 1)} \)

Some things to note:

Remember to use a backslash before "log."

Use an underscore to place the base in subscript.

Use curly braces to group the two-digit base 12.

Use parentheses to group the argument (

*x*+ 1) visually in the final document.

**Trigonometric functions**

**Trigonometric functions**

All six trig functions are typeset by adding a backslash before the function's short name.

The trigonometric functions are given by

**\sin{x}**, **\cos{x}**, **\tan{x}**, **\cot{x}**, **\sec{x}**, and **\csc{x}**

The structure of the trig function commands is similar to that of logarithms.

The backslash is necessary so that the letters of the function's name are not interpreted as variables and thus italicized. For example, you can compare

\( sin{x} \) and \( \sin{x} \)

The curly braces around the argument also do not appear in the final document. Thus, as with logs, consider using parenthesis to make multi-character arguments explicit.

Now that we know how to type the common functions, we will move on to the special symbols required for calculus.

First, let's take a short quiz to check our new knowledge.