As part of my online job, I examine multiple versions of a single calculus question--the only differences in each version are some of the numerical values. As a simple example, different versions of the same question may ask for the derivative of cos(2x), the derivative of cos(3x), the derivative of cos(4x), etc., where the coefficient is randomly generated each time the question is presented.
On more calculated items, especially in multivariable calculus, checking each variation for correctness is time consuming, and I'm trying to reduce the amount of time required by using Mathematica.
After a few unsuccessful attempts (with M informing me that the answer was -infinity), I've been able to get the application to solve (one variation of) a question in which I need to minimize the cost function C = 3lw + 2lh + 2wh under the restriction that volume V = lwh = 81. Here's the code I used:
Minimize[{3 l*w + 2 l*h + 2 w*h,
l*w*h == 81 && l > 0 && w > 0 && h > 0}, {l, w, h}]
This produces the result: {129.[Ellipsis] , {l->81/(3.78[Ellipsis] 5.67[Ellipsis]),w->3.78[Ellipsis],h->5.67[Ellipsis]}}
Following this up with
%//N
produces nice decimal approximations:
{128.579, {l -> 3.77976, w -> 3.77976, h -> 5.66964}}
The exact values are, in order, 81 * 4^(1/3), l = 3 * 2^(1/3), w = 3 * 2^(1/3), and h = 9/2 * 2^(1/3).
As Mathematica is a symbolic system, I found it odd that it wasn't able to solve the problem with exact values, as cube roots don't seem too complex. However, I'm definitely new at Mathematica (I've been proceeding through the Elementary Intro to the Wolfram Language book over the past 2 weeks), so I may be giving M more credit that its due.
I did try using the RootApproximant function (possible incorrectly) on the Minimize[] values, as I found a post where that helped someone convert an irrational decimal output into radical notation. I also tried evaluating the results out to 100 decimal places:
N[Minimize[{3 l*w + 2 l*h + 2 w*h,
l*w*h == 81 && l > 0 && w > 0 && h > 0}, {l, w, h}], 100]
and then RootApproximant[]'ing each one on its own line, but that didn't produce the exact values, either.
Any advice on how I can cajole Mathematica into outputing the exact, radical versions of the solution?