2
$\begingroup$

I have this function ($x>0$) $$f (x)=\frac{\sqrt{g (x)}+4 x \left(x^2+1\right) \sin (\pi x) \cos ((3+\pi ) x)}{x^4+2 x^2+1+\left(4 x^2+\left(x^2-1\right)^2 \cos (2 \pi x)\right)}$$

f[x_] := (
  Sqrt[g[x]] + 4 x (1 + x^2) Cos[(3 + π) x] Sin[π x])/(
  1 + 2 x^2 + x^4 + (4 x^2 + (-1 + x^2)^2 Cos[2 π x]));

where $g(x)=4 x^2+\left(x^2-1\right)^2 \cos (2 \pi x)-\left(x^2+1\right)^2 \cos (2 (3+\pi ) x)\;$.

g[x_] := 4 x^2 + (-1 + x^2)^2 Cos[2 π x] - (1 + x^2)^2 Cos[
     2 (3 + π) x];

I want to check the range of function $f(x)$ for those values of $x$ in which $g(x)\geq0\;$.

-How can I find the domain of $x$ for which $g(x)\geq0\;$?

$\endgroup$
3
  • 2
    $\begingroup$ Did you try to use FunctionDomain[f,x]? $\endgroup$ – tabi_k Aug 24 '20 at 8:42
  • $\begingroup$ @tabi_k Yes, but the result is weird! $\endgroup$ – user73597 Aug 24 '20 at 8:46
  • 1
    $\begingroup$ To get a quick impression of the range of f under condition g>=0, define f2[x_] = ConditionalExpression[f[x], g[x] >= 0] and plot Plot[f2[x], {x, 0, 5}, PlotRange -> All, PlotPoints -> 1000, MaxRecursion -> 15, GridLines -> Automatic] $\endgroup$ – Akku14 Aug 24 '20 at 11:10
1
$\begingroup$

Try ( Thanks @SjoerdSmit helpful comment )

cond=FunctionDomain[{f[x], g[x] >= 0 }, x, Reals] //FullSimplify
(*1 + 6 x^2 + x^4 + (-1 + x^2)^2 Cos[2 \[Pi] x] != 0 && 
4 x^2 + (-1 + x^2)^2 Cos[2 \[Pi] x] >= (1 + x^2)^2 Cos[2 (3 + \[Pi]) x]*)

This condition gives (Thanks @user64494 )

Reduce[N[1 + 6 x^2 + x^4 + (-1 + x^2)^2 Cos[2 \[Pi] x] != 0 &&      4 x^2 +(-1 + x^2)^2 Cos[2 \[Pi] x] >= (1 + x^2)^2 Cos[        2 (3 + \[Pi]) x]] && x>= 0 && x <= 10, x, Reals]
(*0 <= x <= 0.386763 || 0.590121 <= x <= 1.02279 || 
1.02333 <= x <= 1.47324 || 1.60461 <= x <= 2.03514 || 
2.06742 <= x <= 2.43253 || 2.67214 <= x <= 3.049 || 
3.11778 <= x <= 3.42438 || 3.70494 <= x <= 4.06349 || ...<= x <= 10.*)

visualization:

Plot[1, {x, 0, 10}, 
RegionFunction ->Function[{x},1 + 6 x^2 + x^4 + (-1 + x^2)^2 Cos[2 \[Pi] x] != 0 &&4 x^2 + (-1 + x^2)^2 Cos[2 \[Pi] x] >= (1 + x^2)^2 Cos[2 (3 + \[Pi]) x]]]

enter image description here

$\endgroup$
5
  • 1
    $\begingroup$ You can use FullSimplify to make the result a little more compact. $\endgroup$ – Sjoerd Smit Aug 24 '20 at 10:43
  • $\begingroup$ @SjoerdSmit Thanks, I modified my answer. $\endgroup$ – Ulrich Neumann Aug 24 '20 at 10:56
  • $\begingroup$ Additionally, the command Reduce[N[1 + 6 x^2 + x^4 + (-1 + x^2)^2 Cos[2 \[Pi] x] != 0 && 4 x^2 + (-1 + x^2)^2 Cos[2 \[Pi] x] >= (1 + x^2)^2 Cos[ 2 (3 + \[Pi]) x]] && x >= 0 && x <= 10, x, Reals] results in 0 <= x <= 0.386763 || 0.590121 <= x <= 1.02279 || 1.02333 <= x <= 1.47324 || 1.60461 <= x <= 2.03514 || 2.06742 <= x <= 2.43253 || 2.67214 <= x <= 3.049 || 3.11778 <= x <= 3.42438 || 3.70494 <= x <= 4.06349 || 4.168 <= x <= 4.42848 || 4.72776 <= x <= 5.07828 || ... 9.40322 <= x <= 9.49744 || 9.81264 <= x <= 10.. $\endgroup$ – user64494 Aug 24 '20 at 11:11
  • $\begingroup$ @user64494 Tricky definition off "~NReduce" , I didn't know the use Reduce[ N@expr,...] $\endgroup$ – Ulrich Neumann Aug 24 '20 at 11:50
  • $\begingroup$ With TrigExpand you can get the exact values of the zero-crossings sol = Solve[0 <= x < 5 && TrigExpand[g[x]] == 0, x] in form of root expressions like {x -> Root[{Tan[(\[Pi] #1)/2] - #1^2 Tan[(\[Pi] #1)/2] + Tan[1/2 (3 + \[Pi]) #1] + #1^2 Tan[1/2 (3 + \[Pi]) #1] + Tan[(\[Pi] #1)/2]^2 Tan[ 1/2 (3 + \[Pi]) #1] + #1^2 Tan[(\[Pi] #1)/2]^2 Tan[ 1/2 (3 + \[Pi]) #1] + Tan[(\[Pi] #1)/2] Tan[ 1/2 (3 + \[Pi]) #1]^2 - #1^2 Tan[(\[Pi] #1)/2] Tan[ 1/2 (3 + \[Pi]) #1]^2 &, 0.59012140371407271166281}]} . $\endgroup$ – Akku14 Aug 24 '20 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy