```python
from sympy import *
init_printing() # Set up fancy printing
```


```python
# Mencari turunan fungsi menggunakan library sympy
from sympy import symbols, simplify, sqrt, latex

sb, sy, sC, sS, sQ = symbols('b, y, C, s, Q')
sA = sb * sy
sP = sb + 2* sy
sR = sA/sP
sfy = sA*sC*sqrt(sR*sS) - sQ

# Mencari Turunan f(y)
print('Persamaan Q: \n\tf(y)=', sfy, '\n==\n In Latex:', latex(sfy), '\n')
sfy_d = sfy.diff(sy)
print('Turunan Persamaan Q terhadap y : \n\tf\'(y)=', sfy_d, '\n==\n In Latex:', latex(sfy_d), '\n')
print('Bentuk sederhana : \n\tf\'(y)=', simplify(sfy_d), '\n==\n In Latex:', latex(simplify(sfy_d)), '\n')

# Mendefinisikan fungsi dalam python
def f(y):
    return float(sfy.subs({sS: S, sC: C, sb: b, sy: y, sQ: Q}))

def fd(y):
    return float(sfy_d.subs({sS: S, sC: C, sb: b, sy: y}))
```

    Persamaan Q: 
    	f(y)= C*b*y*sqrt(b*s*y/(b + 2*y)) - Q 
    ==
     In Latex: C b y \sqrt{\frac{b s y}{b + 2 y}} - Q 
    
    Turunan Persamaan Q terhadap y : 
    	f'(y)= C*b*sqrt(b*s*y/(b + 2*y)) + C*sqrt(b*s*y/(b + 2*y))*(b + 2*y)*(-b*s*y/(b + 2*y)**2 + b*s/(2*(b + 2*y)))/s 
    ==
     In Latex: C b \sqrt{\frac{b s y}{b + 2 y}} + \frac{C}{s} \sqrt{\frac{b s y}{b + 2 y}} \left(b + 2 y\right) \left(- \frac{b s y}{\left(b + 2 y\right)^{2}} + \frac{b s}{2 \left(b + 2 y\right)}\right) 
    
    Bentuk sederhana : 
    	f'(y)= C*b*sqrt(b*s*y/(b + 2*y))*(3*b + 4*y)/(2*(b + 2*y)) 
    ==
     In Latex: \frac{C b \sqrt{\frac{b s y}{b + 2 y}}}{2 \left(b + 2 y\right)} \left(3 b + 4 y\right) 
    



```python
print(latex(sfy.diff(sy).diff(sy).subs({sy: 5})))
```

    \frac{\sqrt{5} C}{s} \sqrt{\frac{b s}{b + 10}} \left(b + 10\right) \left(- \frac{2 b s}{\left(b + 10\right)^{2}} + \frac{20 b s}{\left(b + 10\right)^{3}}\right) + \frac{\sqrt{5} C}{5 s} \sqrt{\frac{b s}{b + 10}} \left(b + 10\right) \left(\frac{b s}{2 \left(b + 10\right)} - \frac{5 b s}{\left(b + 10\right)^{2}}\right) + \frac{2 C}{s} \sqrt{5} \sqrt{\frac{b s}{b + 10}} \left(\frac{b s}{2 \left(b + 10\right)} - \frac{5 b s}{\left(b + 10\right)^{2}}\right) + \frac{\sqrt{5} C \sqrt{\frac{b s}{b + 10}}}{5 b s^{2}} \left(b + 10\right)^{2} \left(\frac{b s}{2 \left(b + 10\right)} - \frac{5 b s}{\left(b + 10\right)^{2}}\right)^{2}


$$
Persamaan: C b \sqrt{\frac{b s y}{b + 2 y}} + \frac{C}{s} \sqrt{\frac{b s y}{b + 2 y}} \left(b + 2 y\right) \left(- \frac{b s y}{\left(b + 2 y\right)^{2}} + \frac{b s}{2 \left(b + 2 y\right)}\right) 
$$

$$\begin{aligned}y &= 30\ m \\
y &= 10000\ m\end{aligned}
$$

$$\frac{\sqrt{5} C}{s} \sqrt{\frac{b s}{b + 10}} \left(b + 10\right) \left(- \frac{2 b s}{\left(b + 10\right)^{2}} + \frac{20 b s}{\left(b + 10\right)^{3}}\right) + \frac{\sqrt{5} C}{5 s} \sqrt{\frac{b s}{b + 10}} \left(b + 10\right) \left(\frac{b s}{2 \left(b + 10\right)} - \frac{5 b s}{\left(b + 10\right)^{2}}\right) + \frac{2 C}{s} \sqrt{5} \sqrt{\frac{b s}{b + 10}} \left(\frac{b s}{2 \left(b + 10\right)} - \frac{5 b s}{\left(b + 10\right)^{2}}\right) + \frac{\sqrt{5} C \sqrt{\frac{b s}{b + 10}}}{5 b s^{2}} \left(b + 10\right)^{2} \left(\frac{b s}{2 \left(b + 10\right)} - \frac{5 b s}{\left(b + 10\right)^{2}}\right)^{2}
$$


```python

```

d39b64059651bf8a1680bba09394426d76583e5e
ipynb
Jupyter Notebook
playground-misc/playground-sympy.ipynb
taruma/belajar-tsa
ded702846f0453993ba90738a4b6b2401abe9177
MIT
playground-misc/playground-sympy.ipynb
taruma/belajar-tsa
ded702846f0453993ba90738a4b6b2401abe9177
MIT
playground-misc/playground-sympy.ipynb
taruma/belajar-tsa
ded702846f0453993ba90738a4b6b2401abe9177
MIT
Qwen/Qwen-72B
1. YES
2. YES