Investigating How Large Language Models Leverage Internal Knowledge to Perform Complex Reasoning