Author: Suman Shekhar


```python
import sympy as smp
from sympy import *
from sympy.interactive import printing
printing.init_printing(use_latex = True)
from sympy import Eq, solve_linear_system, Matrix
from numpy import linalg
import numpy as np

```


```python
x, y, c = smp.symbols('x y c')
```

# Limits

$$\lim_{x \to \pi} \sin(x/2+ \sin(x))$$


```python
smp.limit(smp.sin(x/2 + smp.sin(x)), x, smp.pi)
```




$\displaystyle 1$



$$ \lim_{x \to 0^+} \frac{2e^{1/x}}{e^{1/x}+1} $$


```python
smp.limit(2*smp.exp(1/x) / (smp.exp(1/x)+1), x, 0, dir='+')
```




$\displaystyle 2$



$$ \lim_{x \to 0^-} \frac{2e^{1/x}}{e^{1/x}+1} $$


```python
smp.limit(2*smp.exp(1/x) / (smp.exp(1/x)+1), x, 0, dir='-')
```




$\displaystyle 0$



$$ \lim_{x \to \infty} \frac{\cos(x)-1}{x} $$


```python
smp.limit((smp.cos(x) - 1)/x, x, smp.oo)
```




$\displaystyle 0$



# Derivatives

$$ \frac{d}{dx} \left( \frac{1+\sin x}{1 - \cos x} \right)^2 $$


```python
smp.diff(((1 + smp.sin(x)) / (1 - smp.cos(x)))**2, x)
```




$\displaystyle \frac{2 \left(\sin{\left(x \right)} + 1\right) \cos{\left(x \right)}}{\left(1 - \cos{\left(x \right)}\right)^{2}} - \frac{2 \left(\sin{\left(x \right)} + 1\right)^{2} \sin{\left(x \right)}}{\left(1 - \cos{\left(x \right)}\right)^{3}}$



$$ \frac{d}{dx} (\log_5 (x))^{x/2}$$


```python
smp.diff(smp.log(x, 5)**(x/2), x)
```




$\displaystyle \left(\frac{\log{\left(x \right)}}{\log{\left(5 \right)}}\right)^{\frac{x}{2}} \left(\frac{\log{\left(\frac{\log{\left(x \right)}}{\log{\left(5 \right)}} \right)}}{2} + \frac{1}{2 \log{\left(x \right)}}\right)$



$$\frac{d}{dx} f(x+g(x)) $$


```python
f, g = smp.symbols('f g', cls=smp.Function)
g = g(x)
f = f(x+g)
```


```python
smp.diff(f,x)
```




$\displaystyle \left(\frac{d}{d x} g{\left(x \right)} + 1\right) \left. \frac{d}{d \xi_{1}} f{\left(\xi_{1} \right)} \right|_{\substack{ \xi_{1}=x + g{\left(x \right)} }}$



# Basic Antiderivatives

$$ \int \csc(x) \cot (x)  dx $$


```python
smp.integrate(smp.csc(x)*smp.cot(x), x)
```




$\displaystyle - \frac{1}{\sin{\left(x \right)}}$



$$ \int 4 \sec (3x) \tan(3x)dx $$


```python
smp.integrate(4*smp.sec(3*x)*smp.tan(3*x), x)
```




$\displaystyle \frac{4}{3 \cos{\left(3 x \right)}}$



$$ \int \left( \frac{2}{\sqrt{1-x^2}} - \frac{1}{x^{1/4}}\right) dx$$


```python
smp.integrate(2/smp.sqrt(1-x**2) - 1/x**smp.Rational(1,4), x)
```




$\displaystyle - \frac{4 x^{\frac{3}{4}}}{3} + 2 \operatorname{asin}{\left(x \right)}$



# Initial Value Problems

1. Given $\frac{dy}{dx} = 8x + \csc^2(x)$ with $y(\pi/2) = -7$  solve for $y(x)$


```python
integral = smp.integrate(8*x + smp.csc(x)**2, x)
```


```python
C = - integral.subs(x, smp.pi/2) - 7
y = integral + C
```


```python
y.subs(x, smp.pi/2)
```




$\displaystyle -7$




```python
y
```




$\displaystyle 4 x^{2} - \pi^{2} - 7 - \frac{\cos{\left(x \right)}}{\sin{\left(x \right)}}$



# More Complicated Expressions

 $$\int \frac{(1+\sqrt{x})^{1/3}}{\sqrt{x}} dx$$


```python
smp.integrate((1+smp.sqrt(x))**smp.Rational(1,3) / smp.sqrt(x), x)
```




$\displaystyle \frac{3 \sqrt{x} \sqrt[3]{\sqrt{x} + 1}}{2} + \frac{3 \sqrt[3]{\sqrt{x} + 1}}{2}$



$$\int x (1-x^2)^{1/4} dx$$


```python
smp.integrate(x*(1-x**2)**smp.Rational(1/4), x)
```




$\displaystyle \frac{2 x^{2} \sqrt[4]{1 - x^{2}}}{5} - \frac{2 \sqrt[4]{1 - x^{2}}}{5}$



$$ \int \frac{(2x-1)\cos(\sqrt{3(2x-1)^2+6})}{\sqrt{3(2x-1)^2+6}} dx $$


```python
smp.integrate((2*x -1)*smp.cos(smp.sqrt(3*(2*x-1)**2 + 6)) / smp.sqrt(3*(2*x-1)**2 + 6), x)
```




$\displaystyle \frac{\sin{\left(\sqrt{3 \left(2 x - 1\right)^{2} + 6} \right)}}{6}$



# Definite Integrals

$$\int_{0}^{\ln(4)}\frac{ce^x dt}{\sqrt{e^{2x}+9}} $$


```python
smp.integrate(smp.exp(x) / smp.sqrt(smp.exp(2*x) + 9), (x, 0, smp.log(4)))
```




$\displaystyle - \operatorname{asinh}{\left(\frac{1}{3} \right)} + \operatorname{asinh}{\left(\frac{4}{3} \right)}$




```python
l= smp.symbols('l')
a = (x**3 - 3*(L**2)*x)
smp.integrate(smp.exp(x) / smp.sqrt(smp.exp(2*x) + 9), (x, 0, smp.log(4)))
```

$$\int_1^t x^{10} e^x dx $$


```python
l= smp.symbols('l')
C2 = smp.symbols('C2')
C3 = smp.symbols('C3')
m = smp.symbols('m')
W2 = (x**3 - 3*(L**2)*x)
W1 = (x**2 - 2*l*x)
Rd = (2*C2 + 6*C3*x) - m+( 270 + C2*W1 + C3*W2)

smp.integrate( W1*Rd, (x,0,0.001))
```




$\displaystyle 1.33333333333333 \cdot 10^{-9} C_{2} l^{2} - 2.000001 \cdot 10^{-6} C_{2} l + 6.66666866666667 \cdot 10^{-10} C_{2} - 3.9999984 \cdot 10^{-9} C_{3} l + 1.49999941666667 \cdot 10^{-12} C_{3} + 1.0 \cdot 10^{-6} l m - 0.00027 l - 3.33333333333333 \cdot 10^{-10} m + 9.0 \cdot 10^{-8}$




```python
smp.integrate( W2*Rd, (x,0,0.001))
```




$\displaystyle 1.6 \cdot 10^{-15} C_{2} l - 2.50000058333333 \cdot 10^{-12} C_{2} - 4.79999805714286 \cdot 10^{-15} C_{3} + 1.25 \cdot 10^{-12} m - 3.375 \cdot 10^{-10}$




```python

```


```python
smp.integrate(x**10*smp.exp(x), (x, 1, t))
```




$\displaystyle \left(t^{10} - 10 t^{9} + 90 t^{8} - 720 t^{7} + 5040 t^{6} - 30240 t^{5} + 151200 t^{4} - 604800 t^{3} + 1814400 t^{2} - 3628800 t + 3628800\right) e^{t} - 1334961 e$



# Improper Integrals

$$ \int_{0}^{\infty} \frac{16 \tan^{-1}(x)}{1+x^2} dx $$


```python
smp.integrate(16*smp.atan(x) / (1+x**2), (x, 0, smp.oo))
```




$\displaystyle 2 \pi^{2}$



# Sequences and Series


```python
n = smp.symbols('n')
```

$$ \sum_{n=0}^\infty \frac{6}{4^n} $$


```python
smp.Sum(6/4**n, (n,0,smp.oo)).doit()
```




$\displaystyle 8$



$$ \sum_{n=0}^\infty \frac{2^{n+1}}{5^n} $$


```python
smp.Sum(2**(n+1) / 5**n, (n,0,smp.oo)).doit()
```




$\displaystyle \frac{10}{3}$



$$ \sum_{n=1}^{\infty} \frac{\tan^{-1}(n)}{n^{1.1}} $$


```python
smp.Sum(smp.atan(n)/n**smp.Rational(11,10), (n,1,smp.oo)).doit()
```




$\displaystyle \sum_{n=1}^{\infty} \frac{\operatorname{atan}{\left(n \right)}}{n^{\frac{11}{10}}}$



$$ \sum_{n=1}^\infty \frac{1 + \cos(n)}{n^2}$$


```python
smp.Sum((1+smp.cos(n))/n**2, (n,1,smp.oo)).n()
```




$\displaystyle 1.969$




```python
m = 400
l= 1

```


```python
2*((l**3)/3 - l**3)
```




    -1.3333333333333335




```python
m*((l**5)/5-3*(l**5)/2 + 4*(l**5)/3)
```




    13.333333333333286




```python
(6/4)*(l**4) -m*((l**6)/6 -3/4*(l**6)) -2*l*(2*l**3 -m*(-4/5*(l**5)))
```




    -409.16666666666663




```python
((l**3)/3-l**3)*270*m
```




    -72000.00000000001




```python

```

c3ca17de470f97980d93086e1c2a0bf9e5d1b182
ipynb
Jupyter Notebook
Maths/math1.ipynb
Sumanshekhar17/Pseudo-Spectral-Method
5d1c2449bafec89006de95f785fe569d488792d9
MIT
2021-09-05T18:21:22.000Z
2021-09-05T18:26:21.000Z
Maths/math1.ipynb
Sumanshekhar17/Pseudo-Spectral-Method
5d1c2449bafec89006de95f785fe569d488792d9
MIT
2021-09-05T18:26:10.000Z
2021-09-14T08:54:49.000Z
Maths/math1.ipynb
Sumanshekhar17/Pseudo-Spectral-Method
5d1c2449bafec89006de95f785fe569d488792d9
MIT
2021-09-06T16:36:35.000Z
2021-09-06T16:36:35.000Z
Qwen/Qwen-72B
1. YES
2. YES