Understanding exponentials, radicals, and logarithms is crucial for many real-world calculations. These concepts extend beyond basic arithmetic operations, delving into more complex mathematical expressions. We will explore these concepts using Deepnote Notebooks, demonstrating how they can be applied in computational contexts.

## Exponentials

Exponentials involve raising a number to a specific power. A common example is squaring a number (raising it to the power of 2). For instance, 2 squared (2^2) equals 4, which can be written as:

\[ 2^{2} = 2 \cdot 2 = 4 \]

Similarly, 2 cubed (2^3) is 8:

\[ 2^{3} = 2 \cdot 2 \cdot 2 = 8 \]

In Python, exponentials are calculated using the `**`

operator. For example, 5 raised to the power of 3 (5^3) is calculated as:

```
x = 5**3
print(x) # Output: 125
```

Exponentials can have any base and exponent. For example, 4 raised to the power of 7 (4^7) equals 16384:

\[ 4^{7} = 16384 \]

## Radicals (roots)

Radicals or roots involve finding the base given a number and an exponent. For instance, the square root of 9 is the number which, when squared, gives 9. This is represented as:

\[ \sqrt{9} = 3 \]

Similarly, the cube root of 64 is 4:

\[ \sqrt[3]{64} = 4 \]

In Python, the `math`

package provides a `sqrt`

function for square roots. Other roots can be calculated by raising the number to the power of the reciprocal of the root. For example, to find the cube root of 64:

```
import math
# Calculate square root of 25
x = math.sqrt(25)
print(x) # Output: 5.0
# Calculate cube root of 64
cr = round(64 ** (1/3))
print(cr) # Output: 4
```

The relationship between roots and exponentials is that the root of a number is equivalent to raising the number to the reciprocal of the exponent. For instance:

\[ 8^{\frac{1}{3}} = \sqrt[3]{8} = 2 \]

And for square roots:

\[ 9^{\frac{1}{2}} = \sqrt{9} = 3 \]

## Logarithms

Logarithms determine the exponent required for a base to produce a given number. For example, to find the power to which 4 must be raised to get 16:

\[ 4^{?} = 16 \]

The answer is 2, as:

\[ \log_{4}(16) = 2 \]

In Python, logarithms can be calculated using the `log`

function in the `math`

package:

```
import math
x = math.log(16, 4)
print(x) # Output: 2.0
```

### Special logarithms

**Common logarithm**: Logarithm with base 10, often written as`log`

.\[ \log(1000) = 3 \]

**Natural logarithm**: Logarithm with base \(e\) (approximately 2.718), written as`ln`

.\[ \log_{e}(64) = \ln(64) = 4.1589 \]

Python's `math.log`

function returns the natural logarithm by default. For the common logarithm, use `math.log10`

:

```
import math
# Natural log of 29
print(math.log(29)) # Output: ~3.367
# Common log of 100
print(math.log10(100)) # Output: 2.0
```

## Solving equations with exponentials

Let's solve an equation involving exponentials:

\[ 2y = 2x^{4} \left( \frac{x^{2} + 2x^{2}}{x^{3}} \right) \]

Simplify the numerator:

\[ x^{2} + 2x^{2} = 3x^{2} \]

Simplify the fraction:

\[ \frac{3x^{2}}{x^{3}} = 3x^{-1} \]

Multiply terms:

\[ 2x^{4} \cdot 3x^{-1} = 6x^{3} \]

Isolate \(y\):

\[ 2y = 6x^{3} \]

\[ y = 3x^{3} \]

We can plot this equation using Python:

```
import pandas as pd
from matplotlib import pyplot as plt
# Create a dataframe with x values
df = pd.DataFrame({'x': range(-10, 11)})
# Calculate y values
df['y'] = 3 * df['x']**3
# Plot the graph
plt.plot(df.x, df.y, color="magenta")
plt.xlabel('x')
plt.ylabel('y')
plt.grid()
plt.axhline()
plt.axvline()
plt.show()
```

## Practical application: Compound interest

Suppose you deposit $100 in a bank account with a 5% annual interest rate. To find the balance after 20 years:

\[ y_{20} = 100 \cdot 1.05^{20} \]

Let's calculate and plot this using Python:

```
# Create a dataframe for 20 years
df = pd.DataFrame({'Year': range(1, 21)})
# Calculate the balance
df['Balance'] = 100 * (1.05 ** df['Year'])
# Plot the graph
plt.plot(df.Year, df.Balance, color="green")
plt.xlabel('Year')
plt.ylabel('Balance')
plt.show()
```

Exponentials, radicals, and logarithms are foundational concepts in mathematics with broad applications in data science, finance, and many other fields. Using Deepnote Notebook, these concepts can be easily explored and visualized, providing a deeper understanding of their behavior and implications. If you encounter any issues, please get in touch with our support. Happy doing math in Deepnote! 🐍