Many common drugs consist of chemicals sourced from crude oil, a situation that needs to change if we're to reduce our dependence on fossil fuels.

Now scientists have managed to make two well-known painkillers, acetaminophen (also known as paracetamol) and ibuprofen, out of a compound found in pine trees. The compound is also a waste product from the paper industry and could be a sustainable replacement for the oil chemicals.

The compound in question is β-pinene, and it comes from turpentine. The researchers were also able to make several other useful chemicals from turpentine, including ones that could be developed into beta blockers, asthma drugs, and cleaning products.

"Our turpentine-based biorefinery model uses waste chemical by-products from the paper industry to produce a spectrum of valuable, sustainable chemicals that can be used in a wide range of applications from perfumes to paracetamol," says Josh Tibbetts, a chemist at the University of Bath in the UK.

The method Tibbetts' team deployed uses what are known as continuous flow reactors, which are exactly what they sound like: chemical reactions happen continuously, rather than in batches, a little bit like a conveyor belt of chemicals.

A carefully calibrated series of reactions are required to get from β-pinene to intermediates for acetaminophen and ibuprofen, with the sort of yields that would make sense in terms of efficiency and scalability.

The method needs development before it can be scaled up to a commercial level, and is likely to be more expensive than processes based on crude oil. That could all change with further refinement, and paying a little extra for now is something we might be more inclined to accept if it means protecting our future on the planet.

Taking a more long term view, fossil fuels are a limited resource. Eventually, we'll need an alternative.

"Using oil to make pharmaceuticals is unsustainable," says Tibbetts.

"Not only is it contributing to rising CO2 emissions, but the price fluctuates dramatically as we are greatly dependent on the geopolitical stability of countries with large oil-reserves, and it is only going to get more expensive."

Many steps in the creation of oil-based products mean more fossil fuel use, from getting it out of the ground in the first place, to refining it into something else. Switching to alternative materials and processes would be another key step in slowing climate change.

The research has been published in ChemSusChem.