# Derivatives of $S_0$

In this notebook we'll validate the analytical expression for the area of the "lens" of overlap between the occulted body and the occultor.


```python
import sympy
from sympy import *
from sympy.functions.special.tensor_functions import KroneckerDelta

# Initialize the session
init_session(quiet=True)

# Let's report what version of sympy this is
print("Using sympy version", sympy.__version__)
```

    
    Using sympy version 1.3


## Define our quantities


```python
S0, k0, k1, r, b, A = symbols("S_0 \kappa_0 \kappa_1 r b A")
```


```python
A = sqrt((1 + r + b) * (b - 1 + r) * (b + 1 - r) * (1 + r - b)) / 2
```


```python
k0 = atan2(2 * A, (r - 1) * (r + 1) + b * b)
```


```python
k1 = atan2(2 * A, (1 - r) * (1 + r) + b * b)
```


```python
S0 = pi - k1 - r ** 2 * k0 + A
```

## Derivative with respect to $b$


```python
simplify(diff(S0, b))
```

This is equal to...


```python
expand(2 * A / b)
```

## Derivative with respect to $r$


```python
simplify(diff(S0, r))
```

This is equal to...


```python
expand(-2 * r * k0)
```

926bcd1fe635451f8b07b4a6ab3f0316ff05ae95
ipynb
Jupyter Notebook
proofs/dS0drb.ipynb
langfzac/Limbdark.jl
a6a30c52e14686a9a01d7b4437f4f171c9c53a24
MIT
2019-05-08T09:03:56.000Z
2021-02-14T20:53:23.000Z
proofs/dS0drb.ipynb
langfzac/Limbdark.jl
a6a30c52e14686a9a01d7b4437f4f171c9c53a24
MIT
2018-04-23T20:41:25.000Z
2019-05-02T01:50:19.000Z
proofs/dS0drb.ipynb
langfzac/Limbdark.jl
a6a30c52e14686a9a01d7b4437f4f171c9c53a24
MIT
2019-05-15T08:06:04.000Z
2020-02-24T19:11:47.000Z
Qwen/Qwen-72B
1. YES
2. YES