```python
# reference https://www.youtube.com/watch?v=_E3CPn6yfgw&ab_channel=RajendraDahal
from IPython.display import Image
from IPython.core.display import HTML 
from sympy import *; x,h,y,n,t,d  = symbols("x h y n t d"); C, D = symbols("C D", real=True)
Image(url= "https://i.imgur.com/yehNtaw.png")
```









```python
Eq(4*x+2*y+4,0)
```




$\displaystyle 4 x + 2 y + 4 = 0$




```python
solve(4*x+2*y+4,y)
```




    [-2*x - 2]




```python
expr = -2*x - 2
Eq(y,-2*x - 2)
```




$\displaystyle y = - 2 x - 2$




```python
Eq(d,sqrt((x-4)**2+(y-1)**2))
```




$\displaystyle d = \sqrt{\left(x - 4\right)^{2} + \left(y - 1\right)^{2}}$




```python
Eq(d,sqrt((x-4)**2+(y.subs(y,expr)-1)**2))
```




$\displaystyle d = \sqrt{\left(- 2 x - 3\right)^{2} + \left(x - 4\right)^{2}}$




```python
def f(x):
    return (x-4)**2+(y.subs(y,expr)-1)**2
f(x)
```




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




```python
diff(f(x))
```




$\displaystyle 10 x + 4$




```python
solve(10*x+4,x)
```




    [-2/5]




```python
diff(f(x),x,2)  #second derivative 
```




$\displaystyle 10$




```python
(-2*x - 2).subs(x,(-2/5))
```




$\displaystyle -1.2$




```python
Image(url= "https://i.imgur.com/eMhm6SD.png")
```








ee2db6f96fda6bd596f57f9f368e1e22d4ecc19b
ipynb
Jupyter Notebook
Calculus_Homework/WWB14.2.ipynb
NSC9/Sample_of_Work
8f8160fbf0aa4fd514d4a5046668a194997aade6
MIT
Calculus_Homework/WWB14.2.ipynb
NSC9/Sample_of_Work
8f8160fbf0aa4fd514d4a5046668a194997aade6
MIT
Calculus_Homework/WWB14.2.ipynb
NSC9/Sample_of_Work
8f8160fbf0aa4fd514d4a5046668a194997aade6
MIT
Qwen/Qwen-72B
1. YES
2. YES