All across the country, Americans will wrap up their Fourth of July celebrations by watching the sky light up with fireworks. If you’re going to be one of them, you have chemistry to thank.

Fireworks displays have become increasingly sophisticated and spectacular, but the chemical reactions that make them possible are pretty basic, according to John Conkling, an adjunct chemistry professor at Washington College in Chestertown, Md., and past executive director of the American Pyrotechnics Assn. Conkling literally wrote the book on fireworks -- it’s called “Chemistry of Pyrotechnics: Basic Principles and Theory,” and it was first published in 1985.

As Conkling explains in the video above, all fireworks have two essential ingredients -- a chemical that’s rich in oxygen (different types of these chemicals produce different colors when they burn) and a chemical that serves as the fuel (different fuels burn at different rates and temperatures).

“Without chemistry, you wouldn’t have the burning mixtures, Conkling says. “Without the burning mixtures, you wouldn’t have fireworks.”

Once these mixtures are made, they are packed into an aerial shell that’s about as big as a snowcone. This cardboard contraption has a pocket of black powder on the bottom, which propels the shell skyward. Inside the pocket is a time fuse that connects to a black powder bursting charge.

That crazy explosion of color and light in the image above is the NGC 4258 galaxy seen in a variety...

Happy Fourth of July, space lovers!

To help you celebrate the holiday, NASA's Chandra X-Ray Observatory released this image of a galactic "fireworks display" in a galaxy 23 million light years away.

That crazy explosion of color and light in the image above is the NGC 4258 galaxy seen in a variety...

(Deborah Netburn)

When the time fuse burns away and the bursting charge explodes, it ignites an array of “effect pellets.” These pellets -- ranging from the size of a pea to the size of a marble -- produce the colors and visual effects that audiences crave.

The entire shell fits inside a cylindrical mortar tube that points the package up toward the sky.

In the video, Conkling (wearing safety glasses!) takes a blowtorch to small piles of powder. A pile containing strontium chloride burns red, a pile made with barium acetate burns green and a pile with copper oxide burns with a blue tint. When “moderately coarse magnesium” is added to the mixture, the combustion produces white sparks.

“Everything you see in a fireworks display is chemistry in action,” he says in the video, which was produced by the American Chemical Society.

In an interview with the PBS program “NOVA,” Conkling said researchers are working to create fireworks that burst in colors like lime green, violet and hot pink. They are also trying to develop shells that will burst in the shape of letters, paving the way for pyrotechnic words.

Conkling’s childhood fascination with fireworks has propelled him through a career that produced eight patents. His work spans both military and civilian uses, but in his view, fireworks are valuable even when they aren’t practical.

“Fireworks make people happy,” he says in the video. “There’s something about watching the night sky explode in color and sparks and noise that I think gets really deep in the human soul.”

Follow me on Twitter @LATkarenkaplan for more on the hidden science in our lives.