501431 divided by 40 
We're looking to find how many times 40 goes into 501431.

Let's proceed to step 1:
40 can be fit into 5 0 times, resulting in a remainder of 5.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we subtract 0 from 5, we get 5.
Take the next digit (0) from the dividend and append it to 5, then repeat: 50 / 40

Advancing to step 2:
40 goes into 50 1 times with a remainder of 10.
Use 1 as the next digit of our solution. 
Result so far: 1.0
Deduct 40 from 50 and we're left with 10.
Bring next digit (1) of the dividend behind the 10 and repeat the process: 101 / 40

Going ahead to step 3:
40 goes into 101 2 times with a remainder of 21.
The next digit of our result is 2. 
Result so far: 12.0
Deduct 80 from 101 and we're left with 21.
Include the next digit (4) from the dividend after 21, then repeat: 214 / 40

Step 4:
40 goes into 214 5 times with a remainder of 14.
Put 5 as the next digit of the answer. 
Result so far: 125.0
If we subtract 200 from 214, we get 14.
Bring next digit (3) of the dividend behind the 14 and repeat the process: 143 / 40

Going ahead to step 5:
40 goes into 143 3 times with a remainder of 23.
The number 3 becomes the next digit in our result. 
Result so far: 1253.0
If we take 120 away from 143, we end up with 23.
Fetch the next digit (1) from the dividend, attach it to 23 and continue: 231 / 40

Step 6:
When dividing 231 by 40, we get 5 with a remainder of 31.
The next digit of our result is 5. 
Result so far: 12535.0
If we take 200 away from 231, we end up with 31.
Since there are no more digits in the dividend, we add a zero to the remainder making it 310, and continue the process.

Moving on to step 7:
When dividing 310 by 40, we get 7 with a remainder of 30.
The number 7 becomes the next digit in our result. 
Result so far: 12535.7
Subtract 280 from 310 to get 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Going ahead to step 8:
40 can be fit into 300 7 times, resulting in a remainder of 20.
The number 7 becomes the next digit in our result. 
Result so far: 12535.77
If we take 280 away from 300, we end up with 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

The final result is 12535.77 with a remainder of 0.02.