Step 1: Hooke’s law states that the extension in a string is proportional to the applied force. Thus, the lengths of the string can be written as:
\[
\ell_1 = k \cdot 4 \quad \text{and} \quad \ell_2 = k \cdot 5,
\]
where \( k \) is the constant of proportionality.
Step 2: The length when the tension is 9N is \( \ell_3 = k \cdot 9 \).
Step 3: Using the linear relationship, the length can be found as:
\[
\ell_3 = 9\ell_1 - 8\ell_2.
\]
Final Answer:
\[
\boxed{9\ell_1 - 8\ell_2}
\]