# How to find a function for decision variable

**URL:** <https://community.wolfram.com/t/how-to-find-a-function-for-decision-variable/24082>\
**Category:** Questions\
**Tags:** algebra, equation-solving, symbolic-computations\
**Created:** [June 10, 2024, 9:40am UTC](https://community.wolfram.com/t/how-to-find-a-function-for-decision-variable/24082 "2024-06-10T09:40:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icebearr54](https://avatars.discourse-cdn.com/v4/letter/i/ed655f/32.png) [@icebearr54](https://community.wolfram.com/u/icebearr54)\
**Post date:** [June 10, 2024, 9:40am UTC](https://community.wolfram.com/t/how-to-find-a-function-for-decision-variable/24082/1 "2024-06-10T09:40:04Z")

</div>

I have a question regarding solving an equation in Mathematica. I want to find the functions of p and T from the equation shown in the attached image in order to determine the optimal solution(p and T is the decision variable)

 ![tp.PNG](https://global.discourse-cdn.com/wolfram/original/3X/7/4/74efcc19105d17966540fb44b2353cb8f14fc471.png)

The example of function of decision variable that I want to obtained is like this (i took this example from another paper):

 ![example.PNG](https://global.discourse-cdn.com/wolfram/original/3X/9/c/9cd2d9336fa85b88ce82ae49e3407a58e6d573a1.png)

Based on some papers I’ve read, to obtain the functions of p and T, I need to differentiate TP with respect to p and T first and then try to get the function of p and T from the resulting equations manually. Is there a way to obtain these functions directly in Mathematica?

I have tried using Solve and NSolve, which worked for simpler equations, but for my equation, I keep encountering errors like ‘Solve::nsmet: This system cannot be solved with the methods available to Solve.’ Today, I retried it, but Mathematica got stuck running for a long time. Is there anything I could do?

Any advice or solutions would be greatly appreciated. Thank you!

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/d2af3151-e355-4c69-aefd-614a7af7d51a)

[total profit.nb](https://community.wolfram.com/uploads/short-url/lsruOqzYMrpVOJwaQzSB7dSO0lx.nb) (7.91 KB)
