Set up the following equations:
![x + y = 40](https://img.qammunity.org/2019/formulas/mathematics/high-school/xwefk8jlcpwpbx3f6lk3cfw0r8e5aaos0s.png)
![20x + 18y = 770](https://img.qammunity.org/2019/formulas/mathematics/high-school/c6sbiq5l9m1dlv61k6mwi5rw29vzllopz9.png)
x is the amount of hours worked on the weekday job, and y is the amount of hours worked on the weekend job.
We'll use substitution to remove one of the variables.
Multiply the first equation by -18 to get opposite coefficients for y:
![-18x - 18y = -720](https://img.qammunity.org/2019/formulas/mathematics/high-school/axuwr7i0dgw9agjareltmyl7r2f9ujgu2y.png)
![20x + 18y = 770](https://img.qammunity.org/2019/formulas/mathematics/high-school/c6sbiq5l9m1dlv61k6mwi5rw29vzllopz9.png)
Combine these two equations together:
![2x = 50](https://img.qammunity.org/2019/formulas/mathematics/high-school/5a8t501nrsqnjdxa7f9riuzmznon7wiidn.png)
Divide both sides by 2 to get x by itself:
![x = 25](https://img.qammunity.org/2019/formulas/mathematics/high-school/j3z31eahmvtqh0mcfsy2tsxsqbsllm9doq.png)
Plug in x to the first original equation:
![25 + y = 40](https://img.qammunity.org/2019/formulas/mathematics/high-school/gp6gcrs49y4hektdskvqqpci1c1h27ar8x.png)
Subtract 25 from both sides to get y by itself:
![y = 15](https://img.qammunity.org/2019/formulas/mathematics/high-school/7rvm3vayaxf9ohofvaqgpi8yzrw1tmhebn.png)
He worked
25 hours at his weekday job, and 15 hours at his weekend job.