Final answer:
The age of the speaker is 18 years.
Step-by-step explanation:
To solve this problem, let's assume that the age of the second student is x years. According to the given information, the first student is twice as old as the second student was when the first student was the same age as the second student. So, we can write the equation: 2(x - y) = x, where y is the age of the first student when the first part of the statement is given. Simplifying the equation, we get x = 2y.
Next, the second part of the statement says that when the second student is the age of the first student, their total age will be 36. Using the equation x = 2y, we substitute x in this equation, and we get 2(2y) + y = 36. Solving this equation, we find y = 9. Therefore, the age of the first student is 18 years.