Answer
a) $1.04$ $J$
b) $10.8$ $cm$
Work Step by Step
a)
If $\int_0^{0.12}{kx}dx$ = $2$ $J$ then
$2$ = $\left[\frac{1}{2}kx^{2}\right]|_0^{0.12}$ = $\frac{x}{y}k(0.0144)$ = $0.0072k$
$k$ = $\frac{2}{0.0072}$ = $\frac{20000}{72}$ =$\frac{2500}{9}$ $N/m$
Thus, the work needed to stretch the spring from $35$ $cm$ to $40$ $cm$ is
$\int_{0.05}^{0.10}{\frac{2500}{9}x}dx$ = $\left[\frac{1250}{9}x^{2}\right]_{1/100}^{1/400}$ = $\frac{25}{24}$ $\approx$ $1.04$ $J$
b)
$f(x)$ = $kx$
so
$30$ = $\frac{2500}{9}x$
$x$ = $\frac{270}{2500}$ $m$= $10.8$ $cm$