After Intel’s strong results this week, yesterday IBM (NYSE:IBM), the world’s leading computer services provider with annual revenue of $103.6 billion, reported a strong second quarter and also increased its 2009 earnings outlook. IBM has benefited from its strategic transformation towards Smarter Planet solutions, business analytics and cloud computing. Let’s take a closer look.

Smarter Planet solutions or smart grid technologies aim to improve the management of energy use and transmission; reducing electricity bills and congestion; and stimulating job growth. IBM has been active in the healthcare and energy sectors, both of which will receive significant a boost from the Obama administration’s stimulus plan.

Setting aside their competitive differences, IBM and Cisco are working to make Amsterdam a “smart city”. They will be developing an energy management system that will be able to securely communicate with household appliances in real time. IBM will set up the smart energy network while Cisco will manage the IP-based communications infrastructure. In another such initiative, IBM is taking a lead role in a broad energy and water metering project in Malta.

In healthcare, where its revenue increased 11%, IBM is working with clients around the world to create smarter health care systems with accessible electronic health records, and uses business analytics to drive efficiency and healthcare quality. Apart from its Smarter Planet initiatives, IBM with Google has announced its own in-home system that could transmit data from devices such as blood-pressure cuffs and glucose meters.

To build its healthcare portfolio, IBM should probably consider acquiring some healthcare IT companies such as Omnicell (NASDAQ:OMCL) with a market cap of $350 million. Read my interview with Omnicell’s CEO to know more about the company, which deals in healthcare automation systems.

athenahealth (NASDAQ:ATHN), a provider of billing and practice management solutions and with market cap of $1 billion, is another acquisition possibility that could boost not just IBM’s healthcare portfolio but also its SaaS portfolio. My interview with athenahealth CEO Jonathan Bush is available here.

As for IMB’s financials, Q2 revenue was down 13% to $23.3 billion versus analyst estimate of $23.59 billion. Net income grew 12% to $3.1 billion or $2.32 per share, beating analyst estimate of $2.02 per share. Despite lower revenue, improved margins and product mix have led to profit growth.

Gross profit margin was 45.5% versus 43.2% last year, led by improving margins in services and software. IBM’s cost-cutting measures such as globalization of its support functions and rebalancing its workforce also contributed to margin improvement, and it expects to save $3.5 billion annually. IBM generated free cash flow of $3.4 billion and ended the quarter with $12.5 billion in cash. Total debt was $29.4 billion, down $1.6 billion from March, and down $4.5 billion from last year. It bought back shares for $1.7 billion and paid $732 million in dividends.

By segment, Systems and Technology revenues were $3.9 billion, down 26% and Software revenue was down 7% to $5.2 billion. Revenues from IBM’s middleware products including WebSphere, Information Management, Tivoli, Lotus and Rational products, were $3 billion, down 2%.