How can I quit an iPhone app on the multitasking dock?

How can I quit an iPhone app on the multitasking dock?

UPDATE: Click here for instructions on how to quit a running app in the iOS 7 app switcher.

Sometimes you need to free up resources such as processing power or memory on your iPhone or other iOS device. There are applications that run in the background in iOS 4 and once launched they will appear in the multitasking dock. Some recently launched applications don't actually run anything in the background but an icon will appear in the multitasking dock anyway. To quit apps using the multitasking dock:

1. If you're currently in an application press the home button so you're starting from the home screen.
2. Double press the home button to bring up the mutitasking dock.
3. Scroll left or right until the app you want to quit is visible in the dock.
4. Press and hold one of the app icons in the dock. The icons will wiggle.
5. Tap the red circle on any apps you wish to quit and they will disappear.
6. When finished quitting apps / removing recently opened app icons tap the home button.
7. Press the home button again or tap the home screen to return.

Quitting apps using the multitasking dock sometimes frees up RAM or exits from an app that might be stuck playing audio in the background, etc.