The rollercoasters main purpose is to build up potential energy. This concept can best be described by as the roller coaster gets higher in the air, gravity has the ability to pull it down a greater distance. This energy you build going up the hill (potential energy) is further released as kinetic energy. This is the energy of motion that takes you down the hill. While going down the hill, gravity takes over and this built up potential energy changes to kinetic energy.
Gravity applies a constant downward force on the cars. At the top of the hill, it is the maximum potential energy. This is then converted into kinetic energy. At the bottom of the hill there is maximum kinetic energy. This energy is what makes the roller coaster go up the second hill.
The gravity pulls the car towards the ground thus providing acceleration to the cart. While the track starts to lift up, the gravity applies this downward force on the back of the coaster which causes decelleration.
Another principle that can be related to a roller coaster is Newton's first law of motion. This states that an object in motion stays in motion. The coaster will maintain the foward velocity.
Another fun fact is that the flunctuation within the coaster from the acceleration is what makes the ride so fun!
Not only is a rollercoaster fun but it involves a ton of physics!