As the largest drugstore operator in the U.S., Walgreen Company (WBA 2.98%) has a strong position in an industry that should benefit from the aging of the U.S. population. However, the company took an earnings hit from its dispute with pharmacy benefit manager Express Scripts (ESRX) in 2012.

Since Walgreen rejoined the Express Scripts network, profit has started to grow again, but not at an especially impressive rate. Earlier this week, Walgreen reported weak earnings for Q2 of its 2014 fiscal year. Adjusted EPS declined from $0.96 to $0.91, missing the average analyst estimate of $0.93.

Walgreen stock rose 3% on Tuesday despite the company's earnings miss.

In spite of the earnings miss, investors sent the stock up by 3% after the earnings report came out on Tuesday. So, why are investors willing to look past bad earnings results in Walgreen's case? The answer probably lies in the company's quest for synergies through two key business combinations.

An international pharmacy chain
Walgreen's first major transaction was its 2012 purchase of a 45% stake in European pharmacy and beauty chain Alliance Boots. Walgreen has the right to buy the rest of Alliance Boots in 2016, and plans to do so. In the meantime, the two companies have begun working together to generate more than $1 billion of annual synergies by 2016.

In the first half of Walgreen's 2014 fiscal year, it and Alliance Boots achieved combined synergies of $236 million. The two companies expect combined synergies of $375 million-$425 million for the full fiscal year. Thus, the integration process is well on the way to meeting the $1 billion synergy goal.

Beyond the synergies generated from the sheer purchasing power of a Walgreen-Alliance Boots combination, the introduction of Boots' beauty products to Walgreen stores could be a major growth driver. The Boots house brand is a leading player in the British beauty/skincare market. If the brand eventually catches on in the U.S., Boots products could become a major attraction driving store traffic and sales growth.

Purchasing efficiencies
After buying its 45% stake in Alliance Boots, Walgreen and Alliance Boots signed a 10-year drug distribution deal with AmerisourceBergen (COR 0.90%). As part of the agreement, Walgreen and Alliance Boots have the right to buy up to 7% of AmerisourceBergen's common stock. The two companies were also granted warrants to buy another 16% of AmerisourceBergen.

Combining the purchasing power of Walgreen, Alliance Boots, and AmerisourceBergen should translate to lower prices for generic drugs. This would allow Walgreen to enjoy a higher profit margin or to reduce prices in a bid for market share. The partnership will also allow Walgreen to carry more obscure drugs, because it will now receive daily deliveries instead of weekly deliveries.

Walgreen has already moved all of its branded drug procurement to AmerisourceBergen, and it began moving to AmerisourceBergen for generic drug purchasing on January 1. By September (the beginning of Walgreen's next fiscal year), the transition to AmerisourceBergen will be complete. This should allow Walgreen to receive the full benefit of its purchasing synergies next year.

Foolish wrap
While Walgreen's profit growth has been choppy for the past few years, it has lofty goals for the next few years. Synergies from its purchase of Alliance Boots and its recent drug distribution deal with AmerisourceBergen should allow Walgreen to reduce its costs.

This gives the company a good shot at meeting its profit growth goals, especially if Walgreen continues gaining market share among drugstores. As a result, investors' faith in Walgreen will probably be rewarded in the long run -- even though it has so far been slow to bounce back from the 2012 Express Scripts dispute.