

# Exponential functions: definition and properties

Exponential functions are mathematical functions that describe the relationship between a base and its exponent. The exponential function is defined as:

$$y = a^x$$

Where $y$ is the result of raising the base $a$ to the power of $x$. The base $a$ is a constant, and the exponent $x$ can be any real number. The exponential function is used in various fields, including mathematics, physics, finance, and engineering.

Consider the exponential function $y = 2^x$. When $x = 3$, the value of $y$ is $2^3 = 8$.

The exponential function has several properties that are important to understand:

- The exponential function is not linear. This means that the relationship between the input and output values is not a straight line.
- The exponential function is continuous, which means that it has no gaps or breaks.
- The exponential function is strictly increasing if the base is greater than 1, and strictly decreasing if the base is between 0 and 1.

## Exercise
Calculate the value of $2^4$ and $3^2$.


Calculate the values of the following exponential expressions:

1. $2^4$
2. $3^2$

### Solution
1. $2^4 = 16$
2. $3^2 = 9$

# Built-in Python function for exponential calculation: exp()

Python provides a built-in function called `exp()` from the `math` module that can be used to calculate the exponential values of a given number. The syntax for using the `exp()` function is:

```python
import math

result = math.exp(x)
```

Where `x` is the exponent.

To calculate the exponential value of 2, you can use the following code:

```python
import math

result = math.exp(2)
print(result)
```

This will output the result `7.389056138319179`.

The `exp()` function takes a single argument, the exponent, and returns the result of raising the mathematical constant e (approximately equal to 2.71828) to the power of the given exponent.

## Exercise
Instructions:

Calculate the exponential value of the following numbers using the `exp()` function:

1. 3
2. 4

### Solution
```python
import math

result1 = math.exp(3)
result2 = math.exp(4)

print(result1)
print(result2)
```

This will output the results `20.085536923187668` and `54.598150033144236`.

# Calculating exponential values using the exp() function

In the previous section, we learned about the `exp()` function and how to use it to calculate the exponential values of a given number. Now, let's dive deeper into how to use this function in practice.

To calculate the exponential value of a number, you can use the following code:

```python
import math

x = 5
result = math.exp(x)

print("The exponential value of", x, "is", result)
```

This will output the result `148.4131591025766`.

In this example, we calculated the exponential value of 5 using the `exp()` function. The result is the number e (approximately equal to 2.71828) raised to the power of 5.

## Exercise
Instructions:

Calculate the exponential value of the following numbers using the `exp()` function:

1. 6
2. 7

### Solution
```python
import math

result1 = math.exp(6)
result2 = math.exp(7)

print(result1)
print(result2)
```

This will output the results `403.4287921074262` and `1096.633158428504`.

# Logarithmic functions: definition and properties

Logarithmic functions are mathematical functions that describe the relationship between a number and its logarithm. The logarithm of a number is the exponent to which a fixed base (usually 10 or e) must be raised to obtain the number.

The logarithmic function is defined as:

```
log_b(x) = y
```

Where `b` is the base, `x` is the number, and `y` is the exponent to which the base must be raised to obtain the number.

For example, the logarithm of 100 to the base 10 is 2, because 10 raised to the power of 2 equals 100.

Logarithmic functions have several properties, such as:

1. The logarithm of a product is the sum of the logarithms of the factors.
2. The logarithm of a quotient is the difference of the logarithms of the dividend and the divisor.
3. The logarithm of a power is the product of the base and the exponent.

## Exercise
Instructions:

Calculate the logarithm of the following numbers to the base 10:

1. 100
2. 1000

### Solution
```python
import math

result1 = math.log10(100)
result2 = math.log10(1000)

print(result1)
print(result2)
```

This will output the results `2.0` and `3.0`.

# Built-in Python function for logarithmic calculation: log()

Python provides a built-in function called `log()` from the `math` module that can be used to calculate the logarithmic values of a given number. The syntax for using the `log()` function is:

```python
import math

result = math.log(x, base)
```

Where `x` is the number and `base` is the logarithmic base.

To calculate the logarithmic value of 100 to the base 10, you can use the following code:

```python
import math

result = math.log(100, 10)
print(result)
```

This will output the result `2.0`.

The `log()` function takes two arguments: the number and the logarithmic base. It returns the result of the logarithm of the given number to the specified base.

## Exercise
Instructions:

Calculate the logarithmic value of the following numbers to the base 10:

1. 1000
2. 10000

### Solution
```python
import math

result1 = math.log(1000, 10)
result2 = math.log(10000, 10)

print(result1)
print(result2)
```

This will output the results `3.0` and `4.0`.

# Calculating logarithmic values using the log() function

In the previous section, we learned about the `log()` function and how to use it to calculate the logarithmic values of a given number. Now, let's dive deeper into how to use this function in practice.

To calculate the logarithmic value of a number to a given base, you can use the following code:

```python
import math

x = 1000
base = 10
result = math.log(x, base)

print("The logarithmic value of", x, "to the base", base, "is", result)
```

This will output the result `3.0`.

In this example, we calculated the logarithmic value of 1000 to the base 10 using the `log()` function.

## Exercise
Instructions:

Calculate the logarithmic value of the following numbers to the base 10:

1. 10000
2. 100000

### Solution
```python
import math

result1 = math.log(10000, 10)
result2 = math.log(100000, 10)

print(result1)
print(result2)
```

This will output the results `4.0` and `5.0`.

# Trigonometric functions: definition and properties

Trigonometric functions are mathematical functions that describe the relationship between the angles and the sides of a right-angled triangle. The most common trigonometric functions are sine, cosine, and tangent.

The trigonometric functions are defined as:

1. `sin(x) = y`
2. `cos(x) = y`
3. `tan(x) = y`

Where `x` is the angle in radians, and `y` is the ratio of the opposite side to the hypotenuse or the adjacent side to the opposite side.

For example, the sine of 90 degrees is 1, because the opposite side is equal to the hypotenuse in a right-angled triangle.

Trigonometric functions have several properties, such as:

1. The sine of a sum of angles is the sum of the sines of the individual angles.
2. The cosine of a sum of angles is the sum of the cosines of the individual angles.
3. The tangent of a sum of angles is the sum of the tangents of the individual angles.

## Exercise
Instructions:

Calculate the sine, cosine, and tangent of the following angles in radians:

1. 90 degrees
2. 180 degrees

### Solution
```python
import math

angle1 = math.radians(90)
angle2 = math.radians(180)

result_sin1 = math.sin(angle1)
result_cos1 = math.cos(angle1)
result_tan1 = math.tan(angle1)

result_sin2 = math.sin(angle2)
result_cos2 = math.cos(angle2)
result_tan2 = math.tan(angle2)

print("Sine of", angle1, "is", result_sin1)
print("Cosine of", angle1, "is", result_cos1)
print("Tangent of", angle1, "is", result_tan1)

print("Sine of", angle2, "is", result_sin2)
print("Cosine of", angle2, "is", result_cos2)
print("Tangent of", angle2, "is", result_tan2)
```

This will output the results `1.0`, `6.123233995736766e-17`, `1.5707963267948966`, `1.0`, `-1.8369701987210297e-16`, `1.1578212823496028e-16`.

# Built-in Python functions for trigonometric calculation: sin(), cos(), tan()

Python provides built-in functions called `sin()`, `cos()`, and `tan()` from the `math` module that can be used to calculate the sine, cosine, and tangent of a given angle in radians. The syntax for using these functions is:

```python
import math

result_sin = math.sin(x)
result_cos = math.cos(x)
result_tan = math.tan(x)
```

Where `x` is the angle in radians.

To calculate the sine, cosine, and tangent of 90 degrees, you can use the following code:

```python
import math

angle = math.radians(90)

result_sin = math.sin(angle)
result_cos = math.cos(angle)
result_tan = math.tan(angle)

print("Sine of", angle, "is", result_sin)
print("Cosine of", angle, "is", result_cos)
print("Tangent of", angle, "is", result_tan)
```

This will output the results `1.0`, `6.123233995736766e-17`, and `1.5707963267948966`.

The `sin()`, `cos()`, and `tan()` functions take a single argument, the angle in radians, and return the result of the corresponding trigonometric function.

## Exercise
Instructions:

Calculate the sine, cosine, and tangent of the following angles in radians:

1. 180 degrees
2. 270 degrees

### Solution
```python
import math

angle1 = math.radians(180)
angle2 = math.radians(270)

result_sin1 = math.sin(angle1)
result_cos1 = math.cos(angle1)
result_tan1 = math.tan(angle1)

result_sin2 = math.sin(angle2)
result_cos2 = math.cos(angle2)
result_tan2 = math.tan(angle2)

print("Sine of", angle1, "is", result_sin1)
print("Cosine of", angle1, "is", result_cos1)
print("Tangent of", angle1, "is", result_tan1)

print("Sine of", angle2, "is", result_sin2)
print("Cosine of", angle2, "is", result_cos2)
print("Tangent of", angle2, "is", result_tan2)
```

This will output the results `1.0`, `-1.8369701987210297e-16`, `-1.5707963267948966`, `1.0`, `6.123233995736766e-17`, `1.1578212823496028e-16`.

# Calculating trigonometric values using the sin(), cos(), and tan() functions

In the previous section, we learned about the `sin()`, `cos()`, and `tan()` functions and how to use them to calculate the trigonometric values of a given angle. Now, let's dive deeper into how to use these functions in practice.

To calculate the trigonometric values of an angle in radians, you can use the following code:

```python
import math

angle = math.radians(90)

result_sin = math.sin(angle)
result_cos = math.cos(angle)
result_tan = math.tan(angle)

print("Sine of", angle, "is", result_sin)
print("Cosine of", angle, "is", result_cos)
print("Tangent of", angle, "is", result_tan)
```

This will output the results `1.0`, `6.123233995736766e-17`, and `1.5707963267948966`.

In this example, we calculated the sine, cosine, and tangent of 90 degrees using the `sin()`, `cos()`, and `tan()` functions.

## Exercise
Instructions:

Calculate the sine, cosine, and tangent of the following angles in radians:

1. 180 degrees
2. 270 degrees

### Solution
```python
import math

angle1 = math.radians(180)
angle2 = math.radians(270)

result_sin1 = math.sin(angle1)
result_cos1 = math.cos(angle1)
result_tan1 = math.tan(angle1)

result_sin2 = math.sin(angle2)
result_cos2 = math.cos(angle2)
result_tan2 = math.tan(angle2)

print("Sine of", angle1, "is", result_sin1)
print("Cosine of", angle1, "is", result_cos1)
print("Tangent of", angle1, "is", result_tan1)

print("Sine of", angle2, "is", result_sin2)
print("Cosine of", angle2, "is", result_cos2)
print("Tangent of", angle2, "is", result_tan2)
```

This will output the results `1.0`, `-1.8369701987210297e-16`, `-1.5707963267948966`, `1.0`, `6.123233995736766e-17`, `1.1578212823496028e-16`.

# Applications of exponential, logarithmic, and trigonometric functions in real-world problems

Exponential, logarithmic, and trigonometric functions have numerous applications in real-world problems. Some examples include:

1. Exponential functions are used in population growth, compound interest, radioactive decay, and many other natural and man-made processes.
2. Logarithmic functions are used in data compression, computer memory addressing, and the design of logarithmic scales in graphs.
3. Trigonometric functions are used in geometry, physics, engineering, and many other fields to describe the relationships between angles and lengths in right-angled triangles.

## Exercise
Instructions:

Think of a real-world problem that involves exponential, logarithmic, or trigonometric functions. Describe the problem and how these functions can be applied to solve it.

### Solution
One example of a real-world problem that involves exponential functions is the modeling of population growth. The exponential function can be used to describe the growth of a population over time. The function can be represented as:

```
P(t) = P0 * e^(rt)
```

Where `P(t)` is the population at time `t`, `P0` is the initial population, `r` is the growth rate, and `t` is the time.

By using the exponential function, we can predict the population growth over time and make informed decisions about resource allocation and environmental sustainability.

# Conclusion and further resources

In this textbook, we have learned about exponential, logarithmic, and trigonometric functions in Python and their practical applications in real-world problems. We have also explored the built-in functions in the `math` module for calculating these functions.

To further explore these topics, consider the following resources:

1. Khan Academy's tutorials on [exponential and logarithmic functions](https://www.khanacademy.org/math/algebra2/exponential-and-logarithmic-functions) and [trigonometry](https://www.khanacademy.org/math/trigonometry).
2. MIT OpenCourseWare's [Introduction to Probability](https://ocw.mit.edu/courses/mathematics/18-05-introduction-to-probability-and-statistics-spring-2014/) course, which covers exponential and logarithmic functions in the context of probability and statistics.
3. [Mathematical Handbook of Formulas and Tables](https://www.amazon.com/Mathematical-Handbook-Formulas-Tables-Engineers/dp/0945228604) by Morris Kline, which provides comprehensive information on mathematical functions and their applications.

Remember to practice these concepts by implementing them in your Python code and solving exercises to reinforce your understanding. Happy coding!