UBS and Deutsche Bank emerged from the tough second quarter without many bruises. At the Swiss bank, net income was 40pc ahead of analysts’ expectations. The German’s numbers were decent and there were no bad surprises.Investors loved the UBS results, pushing up the share price by 9pc on Tuesday morning. There was much to cheer, even after stripping out the bizarre accounting profit from a reduction in the market value of the bank’s own debt.Underlying investment banking revenues did fall by 25pc from the first quarter, but that was less than the drop of around 40pc at many rivals, including Deutsche Bank. Equity traders at UBS even managed to do 9pc better, while Deutsche’s fell back by 32pc. UBS said it dodged losses on derivatives during the May volatility spike.Volatility can help as well as hurt traders. In foreign exchange, for example, UBS was making more than 10 times its usual margins trading euros as Europe’s debtcrisis reached a crescendo. The business generated 50pc more than in the first quarter for UBS and a record quarter for Deutsche.Meanwhile, the steady recovery at UBS’s private banking continues apace. Asset outflows slowed to a trickle and the operating profit margins improved a notch to 95 basis points. Still, a dramatic increase in profitability will have to wait for more normal interest rates.Deutsche’s shares were up a relatively modest 4pc, but the bank is becoming less volatile. The transaction banking business provided almost a quarter of group operating earnings, although profits were inflated by a one-off gain on the acquisition of ABN Amro’s Dutch commercial bank. Deutsche also revealed that its exposure to troubled European sovereigns was about as high as expected.Despite plunging markets and jittery investors, the annualised return on equity at UBS was 20pc in the first half of the year. At Deutsche it was 15pc, while Credit Suisse also came in at 20pc. It wasn’t so long ago pessimists were warning that almost all investment banks would struggle to get ROEs in double digits. These results suggest otherwise.