Abstract In this paper, we present a new methodology, based on the inverse problem approach, for the determination of an unknown shear force acting on the inaccessible tip of the microcantilever, which is a key component of transverse dynamic force microscopy (TDFM). The mathematical modelling of this phenomenon leads to the inverse problem of determining the shear force g ( t ) {g(t)} acting on the inaccessible boundary x = ℓ {x=\ell} in a system governed by the variable coefficient Euler–Bernoulli equation ρ A ( x ) u t t + μ ( x ) u t + ( r ( x ) u x x + κ ( x ) u x x t ) x x = 0 , ( x , t ) ∈ ( 0 , ℓ ) × ( 0 , T ) , \rho_{A}(x)u_{tt}+\mu(x)u_{t}+(r(x)u_{xx}+\kappa(x)u_{xxt})_{xx}=0,\quad(x,t)% \in(0,\ell)\times(0,T), subject to the homogeneous initial conditions and the boundary conditions u ( 0 , t ) = u 0 ( t ) , u x ( 0 , t ) = 0 , ( u x x ( x , t ) + κ ( x ) u x x t ) x = ℓ = 0 , ( - ( r ( x ) u x x + κ ( x ) u x x t ) x ) x = ℓ = g ( t ) , u(0,t)=u_{0}(t),\quad u_{x}(0,t)=0,\quad(u_{xx}(x,t)+\kappa(x)u_{xxt})_{x=\ell% }=0,\quad\bigl{(}-(r(x)u_{xx}+\kappa(x)u_{xxt})_{x}\bigr{)}_{x=\ell}=g(t), from the final time measured output (displacement) u T ( x ) := u ( x , T ) {u_{T}(x):=u(x,T)} . We introduce the input-output map ( Φ g ) ( x ) := u ( x , T ; g ) {(\Phi g)(x):=u(x,T;g)} , g ∈ 𝒢 {g\in\mathcal{G}} , and prove that it is a compact and Lipschitz continuous linear operator. Then we introduce the Tikhonov functional J ( F ) = 1 2 ∥ Φ g - u T ∥ L 2 ( 0 , ℓ ) 2 J(F)=\frac{1}{2}\lVert\Phi g-u_{T}\rVert_{L^{2}(0,\ell)}^{2} and prove the existence of a quasi-solution of the inverse problem. We derive a gradient formula for the Fréchet gradient of the Tikhonov functional through the corresponding adjoint problem solution and prove that it is a Lipschitz continuous functional. The results of the numerical experiments clearly illustrate the effectiveness and feasibility of the proposed approach.