How do I relate $ds$ to $dx$? 
A block of mass $5\text{ kg}$ is kept on an inclined plane with angle of inclination $37°$, attached to a spring with spring constant $10\text{ N/m}$ kept at the base of the incline. 
The coefficient of friction between the inclined plane and block is $0.2$.
At $t = 0$, the block is at rest. 
Find the minimum work done by an agent to pull the block up the incline by $1\text{ m}$.

My approach to the question: 
As the block is at rest, we can find the compression in the spring.
$$Mg\sin(37°) = 10k + N(0.2)$$
where $k$ is the compression in spring
We can find $k = 2.2\text{ m}$.
Then we can find the force required to pull the block up by $1\text{ m}$
$$F_a = 38 - 10x$$
Now, using $\mathrm{d}w = \vec{F}\cdot\mathrm{d}\vec{s}$,
$$\begin{align}
\mathrm{d}w &= \vec{F}_a\cdot\mathrm{d}\vec{s} \\
\mathrm{d}w &= (38-10x)\mathrm{d}s
\end{align}$$
Here is my problem. How do I integrate the function. That is how do I express $\mathrm{d}s$ in terms of $\mathrm{d}x$?
$\mathrm{d}x$ is the compression in spring whereas $\mathrm{d}s$ is the displacement. How do I relate displacement with the compression in spring.
 A: The symbol $d\vec s$ means $\hat x\, dx + \hat y\,dy$. Then you can use dot product between $\vec F_\text{agent}$ and $d\vec s$ once you have a complete vector expression for $\vec F_\text{agent}$, which I don't think you have yet. (Consider the gravitational & frictional forces.)
A: Perhaps this diagram will help:

Also keep in mind that $\mathrm{d}s$ is measured along the path of the object's motion.
If you want to improve your understanding of this concept, after you finish this problem, try doing a modified version of the problem in which the block moves up the ramp until it is $1\text{ m}$ vertically above the ground, instead of moving $1\text{ m}$ up the ramp. Remember that drawing a picture is often very useful.
A: First of all we need to define our variables. 
Let $x$ be the displacement from the point of equilibrium of the spring and have direction parallel to slope.
Initially the spring the is compressed slightly due the the force of gravity, so we need to find the initial point where the block sits.
\begin{aligned}
 -Mg\sin(37^\circ) + (-kx) &= 0\\
-Mg\sin(37^\circ) &= 10x\\
x &= \frac{-Mg\sin(37^\circ)}{10}\\
\end{aligned}
Lets call this $x_1$. Note that I have defined $g = 9.8$ so x_1 is less than zero. The point we need to end up at is $x_2 = x_1 + 1$
now we need to find the work in sliding the block up the incline. The force $F_{\text{agent}}$ that needs to be applied is that which balances out the opposing forces. So we have
\begin{aligned}
F_{\text{agent}} + F_{\text{spring}} + F_{g} + F_{\text{Friction}} &= 0\\
F_{\text{agent}} - 10x - Mg\sin(37^\circ) - 0.2F_N&= 0\\
F_{\text{agent}} &=  10x + Mg\sin(37^\circ) + 0.2F_N
\end{aligned}
where $F_N$ is the normal force of the block and is given by $F_N= Mg\cos(37^\circ)$
Now we use the fact that $W = \int_{x_1}^{x_2} \vec{F}\cdot d\vec{s}$, where $d\vec{s}$ is the displacement in the direction of the blocks motion. Since we have chosen the $x$ direction to coincide with this direction 
$$\vec{F} \cdot d\vec{s} = F_{\text{agent}}dx$$
hence
\begin{aligned}
W &= \int_{x_1}^{x_2} \vec{F}\cdot d\vec{s}\\
&= \int_{x_1}^{x_2}F_{\text{agent}}dx\\
&= \int_{x_1}^{x_2} \left(10x + Mg\sin(37^\circ) + 0.2F_N\right) dx\\
&= \left[5x^2 + (Mg\sin(37^\circ) + 0.2F_N)x\right]_{x_1}^{x_2}\\
&=5(x_2^2-x_1^2) + Mg(\sin(37^\circ) + 0.2\cos(37^\circ))(x_2-x_1)
\end{aligned}
using a calculator you can find the values of $x_1$, $x_2$, etc arriving at your final answer.
