To find out how many hours Brendan needs to spend in class to have a total of 18 pages of notes (p = 18), we can substitute 18 into the equation \( p = h + 13 \):
\[ 18 = h + 13 \]
Next, we solve for \( h \) by subtracting 13 from both sides:
\[ 18 - 13 = h \]
This simplifies to:
\[ h = 5 \]
Therefore, Brendan needs to spend 5 hours in class to have a total of 18 pages of notes in his notebook.