# FindInstance fails to find integer solutions to glaringly obvious problems

This is a continuation question to Sums as rational vector dot products with a basis constants vector.

Consider the following FindInstance query. Looks easy, doesn't it?

FindInstance[(x + y Sinh + z Cosh)/d ==
(1 + Sinh + Cosh)/2 && d > 0, {x, y, z, d}, Integers]


FindInstance::nsmet: The methods available to FindInstance are insufficient to find the requested instances or prove they do not exist.

So, no. Many of queries of the same form (varying expected x, y, z and d) succeed trivially, while others fail mysteriously. What gives?

TrigExpand resolves the problem for these specific constants (Sinh and Cosh), but that's not what I'm looking for. I'm looking for a general solution to the problem of reliable extraction of multipliers to non-rational constants.

EDIT:

It is not that this specific case would be hard to work out by finding a suitable method. I'd naively expect that any integer combination of x, y, z and (non-zero) d should be trivially recoverable for any such, even structurally obvious linear combination of basis constants (1, Sinh and Cosh). I would expect this process to have $O(1)$ run time complexity on size of these integers if the form is essentially exactly the same on both sides, and to never fail.

FindInstance works fine, after all, with many combinations of above variables even when they're like hundred digits long. What is the technical approach FindInstance takes here? What would be a more robust method for these kind of problems?

• maybe FindInstance[ Rationalize[ N[(x + y Sinh + z Cosh)/d == (1 + Sinh + Cosh)/2]] && d > 0, {x, y, z, d}, Integers]? – kglr Aug 11 '18 at 20:38
• @kglr That's not a result of practical value to me, though. Also, my root question is... what on Earth is going behind the scenes if FindInstance fails to find the symbolic result? – kirma Aug 11 '18 at 20:41
• Funny, FindInstance[(x + y Sinh + z Cosh)/-minusd == (1 + Sinh + Cosh)/2 && minusd < 0, {x, y, z, minusd}, Integers] works… – xzczd Aug 12 '18 at 15:05

FindInstance works in this case if you require all variables to be positive

FindInstance[(x + y Sinh + z Cosh)/d == (1 + Sinh + Cosh)/
2 && (And @@ Thread[{x, y, z, d} > 0]), {x, y, z, d}, Integers]

(* {{x -> 1, y -> 1, z -> 1, d -> 2}} *)


Finding other solutions by brute force

max = 10;

Thread[{x, y, z, d} -> #] & /@ (Most /@
Select[Flatten[
Table[{x, y, z,
d, (x + y Sinh + z Cosh)/d == (1 + Sinh + Cosh)/2 &&
d > 0}, {x, max}, {y, max}, {z, max}, {d, max}], 3], #[] &])

(* {{x -> 1, y -> 1, z -> 1, d -> 2}, {x -> 2, y -> 2, z -> 2, d -> 4}, {x -> 3,
y -> 3, z -> 3, d -> 6}, {x -> 4, y -> 4, z -> 4, d -> 8}, {x -> 5, y -> 5,
z -> 5, d -> 10}} *)


Generalizing,

(x + y Sinh + z Cosh)/d == (1 + Sinh + Cosh)/2 &&
d > 0 /. {x -> n, y -> n, z -> n, d -> 2 n} // Simplify[#, n > 0] &

(* True *)