# Minimize beats Solve

Posted 1 month ago
577 Views
|
3 Replies
|
3 Total Likes
|
 This is the second step in solving a problem Reygan Dionisio posted on LinkedIn Solve[{res == b/a, a == 9^k, b == 15^k, a + 2 b == 25^k, a > 0, b > 0}, {a, b, k}] During evaluation := Solve::nsmet: This system cannot be solved with the methods available to Solve. Solve[{res == b/a, a == 9^k, b == 15^k, a + 2 b == 25^k, a > 0, b > 0}, {a, b, k}] MinValue[{ b/a, a == 9^k, b == 15^k, a + 2 b == 25^k, a > 0, b > 0}, {a, b, k}] // FullSimplify 1 + Sqrt MaxValue[{ b/a, a == 9^k, b == 15^k, a + 2 b == 25^k, a > 0, b > 0}, {a, b, k}] // FullSimplify 1 + Sqrt Answer
3 Replies
Sort By:
Posted 1 month ago
 Frank,The reason Solve fails is that you have more variables in the equations than you told Solve about. This works (by adding res to the list of variables): Solve[{res == b/a, a == 9^k, b == 15^k, a + 2 b == 25^k, a > 0, b > 0}, {a, b, k, res}] as does this (let Solve figure out the variables): Solve[{res == b/a, a == 9^k, b == 15^k, a + 2 b == 25^k, a > 0, b > 0}] However, the minimize approach runs faster if you know that the minimum is the solution.Regards,Neil Answer
Posted 1 month ago
 MinValue is 100 times faster than Solve In:= AbsoluteTiming[ Solve[{res == b/a, a == 9^k, b == 15^k, a + 2 b == 25^k, a > 0, b > 0}, {a, b, k, res}] // FullSimplify] Out= {84.9759, {{a -> 9^(ArcSinh/Log[5/3]), b -> 15^(ArcSinh/Log[5/3]), k -> ArcSinh/Log[5/3], res -> 1 + Sqrt}}} In:= AbsoluteTiming[ MinValue[{ b/a, a == 9^k, b == 15^k, a + 2 b == 25^k, a > 0, b > 0}, {a, b, k}] // FullSimplify] Out= {0.399868, 1 + Sqrt} Answer
Posted 1 month ago
 PositiveReals puts a constraint on every variable. A notebooks is attached with code.  Attachments: Answer