Present a logarithm in terms of two logarithms

If $$\log _8 3=p$$ and $$\log _3 5=q$$ then, in terms of $$p$$ and $$q$$, what does $$\log _{10} 5$$ equal? I tried by my hand, I get the answer is $$\dfrac{3pq}{1+3pq}$$. How can I tell Mathematica solve it?

With Maple, I see here

https://www.mapleprimes.com/questions/220264-How-Do-I-Find-A-Logarith-In-Term-A-Given

There doesn't seem to be a single built-in function for the task, but I can think out a solution involving a bit manual analysis.

First use PowerExpand:

eq = {Log[8, 3] == p, Log[3, 5] == q} // PowerExpand
(* {Log[3]/(3 Log[2]) == p, Log[5]/Log[3] == q} *)

expr = PowerExpand@Log[10, 5]
(* Log[5]/(Log[2] + Log[5]) *)


Then it's clear we just need to solve for Log[2] and Log[5] from eq. This can be done by:

freeze = Log -> Inactive[Log];

rule = {eq, Log@{2, 5}} /. freeze // Apply@Solve
(* {{Inactive[Log][2] -> Inactive[Log][3]/(3 p),
Inactive[Log][5] -> q Inactive[Log][3]}} *)

expr /. Activate@rule[[1]] // Simplify
(* (3 p q)/(1 + 3 p q) *)


I've used Inactive to freeze Log because Log[2], etc. cannot be used as 2nd argument of Solve.

You can of course build a general solver for the same class of problem:

help[lst_, target_] := (
expr = PowerExpand@target;
eq = PowerExpand@lst;

findlog = Union@Cases[#, _Log, Infinity] &;

argu = findlog@expr;
argu2 = Complement[findlog@eq, argu];

freeze = Log -> Inactive[Log];

rule = {eq, argu, argu2} /. freeze // Apply@Solve // Quiet;

expr /. Activate@rule[[1]] // Simplify)


Example:

help[{Log[8, 3] == p, Log[3, 5] == q}, Log[10, 5]]


$$\frac{3 p q}{3 p q+1}$$

help[Log[{2, 3, 7}, {3, 5, 2}] == {a, b, c}, Log[140, 63]]


$$\frac{2 a c+1}{a b c+2 c+1}$$

help[Log[{140, 3, 7}, {6, 5, 2}] == (Subscript[a, #] & /@ Range[3]), Log[2, 3]]


$$\frac{a_3-a_1 \left(2 a_3+1\right)}{\left(a_1 a_2-1\right) a_3}$$

help[Log[{140, 3, 7, 2}, {6, 5, 2, 66}] == (Subscript[a, Range[4]] // Thread),
Log[11, 12]]


$$\frac{a_1 \left(2 \left(a_2-1\right) a_3-1\right)-a_3}{a_1 \left(a_3 \left(a_2 \left(a_4-1\right)+2\right)+1\right)-a_3 a_4}$$

I doubt if this makes much sense, though…