Question: Consider the expansion of $\left(3x+\frac{p}{x}\right)^8$, where $p>0$. The coefficient of the term in $x^4$ is equal to the coefficient of the term in $x^6$. Find $p$.
1. **State the problem:** We need to find the value of $p$ such that in the expansion of $$\left(3x+\frac{p}{x}\right)^8$$ the coefficients of the terms with $x^4$ and $x^6$ are equal.
2. **General term in the expansion:** The binomial expansion of $\left(a+b\right)^n$ is given by $$\sum_{k=0}^n \binom{n}{k} a^{n-k} b^k.$$ Here, $$a = 3x, \quad b = \frac{p}{x}, \quad n=8.$$
The general term $T_{k+1}$ is:
$$T_{k+1} = \binom{8}{k} (3x)^{8-k} \left(\frac{p}{x}\right)^k = \binom{8}{k} 3^{8-k} p^k x^{8-k-k} = \binom{8}{k} 3^{8-k} p^k x^{8-2k}.$$
3. **Find $k$ for terms with $x^4$ and $x^6$: **
- For $x^4$, exponent of $x$ is $4$, so:
$$8 - 2k = 4 \implies 2k = 4 \implies k = 2.$$
- For $x^6$, exponent of $x$ is $6$, so:
$$8 - 2k = 6 \implies 2k = 2 \implies k = 1.$$
4. **Write coefficients for these terms:**
- Coefficient of $x^4$ term (when $k=2$):
$$C_4 = \binom{8}{2} 3^{8-2} p^2 = \binom{8}{2} 3^6 p^2.$$
- Coefficient of $x^6$ term (when $k=1$):
$$C_6 = \binom{8}{1} 3^{8-1} p^1 = \binom{8}{1} 3^7 p.$$
5. **Set coefficients equal and solve for $p$: **
$$\binom{8}{2} 3^6 p^2 = \binom{8}{1} 3^7 p.$$
Divide both sides by $p$ (since $p>0$) and by $3^6$:
$$\binom{8}{2} p = \binom{8}{1} 3.$$
Substitute values:
$$28 p = 8 \times 3 = 24.$$
So,
$$p = \frac{24}{28} = \frac{6}{7}.$$
**Final answer:**
$$\boxed{\frac{6}{7}}.$$