How come Boeing invested \$32 billion on the 787 program and Airbus only \$15 billion on the A350? (according to wikipedia)
I don't think the breakdown is public, but there are two main areas that are obvious once you dig into the details.
Part 1 relates to the 787-8 and -9/-10 commonality. Surprisingly, the stretched derivatives only share 50% of the -8 parts. As Wikipedia puts it:
The 787-8 and 787-9 have 50% commonality: the wing, fuselage and systems of the 787-8 had required radical revision to achieve the payload-range goals of the 787-9.
So you could say Boeing developed 1½ planes, while Airbus developed 1. I tried to find details on the differences before, but it was a futile attempt. All the official statements were as vague as they come. (Boeing will implement at least some of the new -9/-10 developments into the future -8's.)
Part 2, Boeing went with an all-electric design,* introducing many new technologies in one go. The A350 still uses pneumatic engine start and bleed air for pressurization. They were improved on the A350, but still they were existing technologies.
* Lithium-ion batteries are not really part of the differences as they were introduced quietly on the A350.
Here are some reasons you could find in Wikipedia English and or French versions which are not exactly similar
The B787 composite body study was very expensive, indeed Airbus built its fuselage more conventionally from four large panels, two forming the flanks, to which are added the lower panel and the flag while that of the B787 is in one piece in autoclaves. Being in one piece the study of each models 787/8/9/10 required a separate Study.
Boeing had repetitively fuel leak problems requiring deep extra studies while the production was already launched.
The 787 APU had unexpected problem, mainly on ground, in some circumstances after being switched off it couldn’t be restarted before a delay of 2 hours.
You know the decision of the FAA to ground the aircraft for more than 3 months due to batteries risk of fire
The A350 is only 50% produced by suppliers outside the group, compared to 70% for the dreamliner, this is a source of coordination and logistic problems
Aware of the lithium batteries problems, Airbus did initially a conventional choice, thus avoiding delivery delays.