without boundary conditions you can't really obtain solution. PDE's are different from ode's. The general solution depends on the boundary conditions because those determine the eigenvalues and eigenfunctions to use.
May be this explains why Mathematica did not solve it? Or may be it did not have templates for this pde.
But here is a workaround using separation of variables. But this solution contains unknown eigenvalue $\lambda$ (which if you had BC, you could determine it), then determine the eigenfunctions $X_n(x)$ and then obtain the general solution as series of solutions of $T_n X_n$ which you add up, then use the initial conditions to find the final unknown constants for the time part.
Quit[]
pde0 = 1/c^2*D[f[t,x],{t,2}]-D[f[t,x],{x,2}]+m^2*c^2/h^2*f[t,x]
pde = pde0/.f->Function[{t,x},T[t]*X[x]]
Expand[pde/(T[t]*X[x])]==0
So we have two ode's equal each others, one depends on $x$ and the other on $t$, hence they both must be equal some constant, say $\lambda^2$. So the two odes' are
ode1 = (c^2*m^2)/h^2 + T''[t]/(c^2*T[t]) == λ^2
ode2 = X''[x]/X[x] == λ^2
Solve them:
solX = DSolveValue[ode2,X[x],x,GeneratedParameters->C]
solT = DSolveValue[ode1, T[t], t, GeneratedParameters -> K]
sol = solX*solT
Verify the solution
sol = f -> Function[{t, x}, Evaluate[sol]]
pde0 /. sol // Simplify
(* 0 *)
Maple 2023 solves this partially giving the solution as products of two functions which are solutions of two ode's (basically the same as above).
pde := 1/c^2* diff(f(t,x),t$2)- diff(f(t,x),x$2) + m^2*c^2/h^2*f(t, x);
pdsolve(pde=0,f(t,x))
Update
The general solution depends on the boundary conditions because those
determine the eigenvalues and eigenfunctions to use.
May be this explains why Mathematica did not solve it?
my suspicion was correct! When adding bc and ic, Mathematica is now able to solve it and give the expected series solution by separation of variables
pde=1/c^2*D[f[t,x],{t,2}]-D[f[t,x],{x,2}]+m^2*c^2/h^2*f[t,x]
bc={f[t,0]==1,(D[f[t,x],x]/.x->Pi)==0}
ic={f[0,x]==0,(D[f[t,x],t]/.t->0)==0}
sol:=DSolve[{pde == 0, bc, ic}, f[t, x], {t, x}]
Next step will be to make a small animation showing the wave moving in time. I made up some numerical values for the unknowns in the pde and made up some BC and IC's.
Code for the above
ClearAll["Global`*"]
pde = 1/c^2*D[f[t, x], {t, 2}] - D[f[t, x], {x, 2}] +
m^2*c^2/h^2*f[t, x]
bc = {f[t, 0] == 1, (D[f[t, x], x] /. x -> Pi) == 0}
ic = {f[0, x] == 0, (D[f[t, x], t] /. t -> 0) == 0}
sol = DSolveValue[{pde == 0, bc, ic}, f[t, x], {t, x}];
sol = sol[[1, 1, 1]]
sol = sol /. {m -> 1, c -> 2, h -> 3, Infinity -> 20} (*make up some values*)
solActive = Activate[sol];
Manipulate[
Grid[{{Row[{"time = ", t0}]},
{Plot[solActive /. t -> t0, {x, 0, 5},
PlotRange -> {Automatic, {-1, 2}}, GridLines -> Automatic,
GridLinesStyle -> LightGray, PlotStyle -> Red,
ImageSize -> 300]}}],
{{t0, 0, "time"}, 0, 10, .1, Appearance -> "Labeled"}
]