How to apply a filter on a title with several concatenated elements? Here's an example:

{% set title = entry.artistFirstName | capitalize ~ ' ' ~ entry.title | capitalize %}


It outputs Firstname title instead of Firstname Title whereas filters are applied on the two concatenated elements. Why and how to add this filter on each of these elements?
I've tested these three methods (the first one from AbbeyDesign's answer,) and they seem to work fine with variables, I can't see any obvious reason why they wouldn't:

{% set entry = { artistFirstName: 'hello', title: 'world' } %}

{% set title = (entry.artistFirstName|capitalize) ~ ' ' ~ (entry.title|capitalize) %}
{% set title = "#{entry.artistFirstName|capitalize} #{entry.title|capitalize}" %}
{% set title = [entry.artistFirstName|capitalize, entry.title|capitalize]|join(' ') %}


Results in "Hello World" in each case.