I am currently reading Fundamentals of Physics (10th edition) and am stumped on a question (Chapter 7, Question 7) regarding the work done by gravity.
The question is as follows: there is a pig that goes down three slides, all three slides are at the same height from the ground, but of different lengths, they are therefore positioned at different angles. I'm asked to rank them by the amount of work the gravitational force does on the pig during each descent.
At this point of the chapter the book has given two apparently relevant formulas for calculating this work: one is that the work done by the gravitational force is equal to $mgd\cos\phi$ (where $m$ is the mass of the object, $g$ is the gravitational acceleration, $d$ is the displacement and $\phi$ is the angle between the force and the displacement), and the other is that $\Delta K = K_{f} - K_{i} = W$ (where the difference in kinetic energies is equal to the work).
Now the book says that along all three slides the amount of work done by the gravitational force is the same, but I fail to see how that is possible applying the first formula. I thought that somehow the cosine would make it so all three works are the same but trying with some plugged in values I get different values for different slides. Applying the second formula, since the kinetic energy of the pig is the same at the beginning and the end I can see how all three works could be zero, but then the works should still be zero if one of the slides happened to be lower that the others, right?
I am truly stumped, I actually know that the work done by gravity does not depend on the path of the object, through the conservation of energy formulas, but I can't understand how you can justify it with the formulas given.