Straight-Line Graph of log_p y against x

Interactive Straight-Line Graph of log_p y against x graph — click to explore
Click the graph to explore it interactively →
Question: Plot a graph of log y base of p-axis vs x-axis, where a straight line passes through (r,s) and (t,u).
In the HKDSE Mathematics syllabus, linear relations between \log_p y and x are frequently tested to represent exponential relationships of the form y = A \cdot k^x.

1. Defining the Variables and the Linear Form

Let the axes be defined as:
  • Horizontal coordinate: X = x
  • Vertical coordinate: Y = \log_p y
The straight line passes through the two points (r, s) and (t, u) on the (x, \log_p y)-plane, meaning:
  • When x = r, \log_p y = s
  • When x = t, \log_p y = u

2. Equation of the Straight Line

The slope m of the straight line is given by: m = \frac{u - s}{t - r}
Using the point-slope form with the point (r, s): Y - s = m(X - r)
Substituting X = x and Y = \log_p y: \log_p y - s = \left(\frac{u - s}{t - r}\right)(x - r)
Rearranging into slope-intercept form: \log_p y = m x + c where the vertical intercept c is: c = s - m r = s - \left(\frac{u - s}{t - r}\right)r

3. Converting to the Non-linear Relation ( y in terms of x)

Applying the definition of logarithm \log_p y = N \iff y = p^N: \begin{align*} \log_p y &= m x + c \\ y &= p^{m x + c} \\ y &= p^c \cdot (p^m)^x \end{align*}
Let A = p^c = p^{s - m r} and k = p^m = p^{\frac{u - s}{t - r}}, then: y = A k^x

4. Key Visual Features on the Graph

  • Points (r, s) and (t, u): Marked in blue, showing the two coordinate pairs on the transformed axes.
  • Slope Triangle: The horizontal run \Delta x = t - r and vertical rise \Delta(\log_p y) = u - s represent the rate of change of the logarithm.
  • Vertical Intercept: The value of \log_p y when x = 0, equal to c = \log_p A.