A tricky maths problem is sweeping the internet – with many offering lengthy explanations of how to solve the question.

Sharing the puzzle online, mathematician Ed Southall, from the University of Huddersfield, posted an image of a pink triangle inside a square, along with the deceivingly simple question: ‘What fraction is shaded?’

Dozens of social media users shared their attempts at solving the difficult problem online, with some admitting they had been left scratching their heads.

However, education charity CEO David Weston has managed to offer a simple explanation of the correct answer.

Mathematician Ed Southall, from the University of Huddersfield, shared the tricky maths problem online

The key to getting the correct answer – which is a third – is working out that the height of the triangle is two thirds the height of the square.

David explained: ‘Pink triangle and little triangle have all the same angles: they’re “similar”.

‘Base of pink is twice base of little [triangle]. So height of pink is also twice height of little.

‘So height of pink is 2/3 of whole square.’

Education charity CEO David Weston offered a simple explanation of the correct answer

The final stage of solving the problem involves using the formula for working out the area of a triangle – which is half x base x height.

As the height is 2/3 of the whole square, you can take the base to be equal to 1 when using the formula.

Therefore, as David explains, the area is half x 1 x two thirds.

This means the area of the triangle a third of the area of the whole square.

Dozens of other social media users have been sharing their solutions to the trick puzzle online, with one explaining: ‘The intersection height is the key’.

Another added: ‘My instinct says it’s 1/3… but I’ll have to work on the explanation!’

Others have also been sharing the way they came to the right answer on Twitter

Many said the key to answering the problem is working out the pink triangle is two thirds the height of the square

While a number got the correct answer, some were left scratching their heads when it came to the explanation