Frédéric Chopin composed his Piano Sonata No. 3 in B minor, Op. 58, in 1844 and dedicated it to Countess Émilie de Perthuis. Along with the previous sonata, this is considered to be one of Chopin's most difficult compositions, both technically and musically. 
The sonata consists of four movements, a similar structure to the second sonata, with a lyrical largo rather than a funeral march.
Among Chopin's piano sonatas this is the only one ending in a major key. A performance of the work lasts around 25 to 30 minutes.
The work opens on a martial note, the heavy chords and filigree in the opening of the first movement giving way to a more melodic second theme, eventually leading to the conclusion of the exposition in the relative major, D. This exposition is quite long compared to other sonatas and it may be for this reason many pianists choose to omit the exposition repeat. Motives of the original theme emerge in the development, which, unconventionally, returns to the second theme (as opposed to the first) for the recapitulation, which is in B major.
The scherzo, in the distant key of E-flat major and in strict ternary form, characterised by ebullient quaver runs in the right hand, with a more demure chordal middle section in B major. If played slowly, the main E-flat major theme sounds somewhat similar to the E-flat major melody from the composer's Ballade No. 1. Unlike the scherzo of the B-flat minor sonata (and, indeed, the rest of Chopin's contributions to the genre outside of the sonatas), it is exceptionally short, typically lasting barely two minutes in performance.
Despite a stormy introduction in dotted rhythm, the largo is serene, almost nocturne-like; an immensely beautiful melody is introduced, followed by a mellow and expansive middle section, again characterised by quaver figuration in the background of an intensely harmonic line, separating the more cantabile outer sections in B major. It is the most musically profound of the movements (Kraemer, 1991), in terms of a sustained melody and innovative harmonic progression; it rivals the extensive first movement in length alone.
Its turbulent and dramatic introduction – a rising harmonic progression left hanging on a high dominant seventh – aside, the finale, in B minor, is pervaded by a "galloping" rhythm; emphasis in the melodic line on the first and third beats of each half-measure outlines the fifth through eighth degrees of a harmonic minor scale, in this case the F♯ and B, lending prominence to the augmented second between the sixth and raised seventh scale degrees, the G and A♯. The overall melody, chromatic yet rooted in the minor tonic, contributes a dark mood to these primary sections. A more triumphant second theme in B major, repeated twice in the movement's A-B-A-B-A form, appears quite suddenly at the conclusion of the first (likewise when repeated); eventually rising during fleet-fingered runs over a left-hand melody, it tumbles back to a dramatic restatement of the main theme in both of its appearances. The piece concludes in a jubilant B major coda.
The sonata has been recorded many times. The first commercial electric recording was made by Percy Grainger in 1925. This has been described as "still one of the greatest accounts on disc ... The finale is simply dazzling".