Chemistry and maths of gas flaring & photosynthesis