R-code for inequalities line by line

I want to calculate efficiently which coordinates (x, y) lie between (x1, y1) and (x2, y2), as indicated in the same line. The inequalities (min and max) are therefore valid line by line and not the entire column of values ​​(x1, y1) or (x2, y2). I would test (cond1) if both x> = min (x1, x2) and x <=max(x1, x2), and (cond2) if both y >= min (y1, y2) and y <= max (y1, y2).

x1 <- c (7, 8, 2, 2, 2, 7, 3)
y1 <- c (9, 3, 2, 5, 8, 7, 9)
x2 <- c (4, 2, 7, 9, 5, 7, 5)
y2 <- c (0, 6, 1, 8, 3, 5, 3)
x <- c (0, 7, 3, 9, 3, 6, 6)
y <- c (7, 0, 7, 4, 8, 9, 7)
K <- data frames (x1, y1, x2, y2, x, y)

The output would look like this:

        x1 y1 x2 y2 x y cond1 cond2
1 7 9 4 0 0 7 0 1
2 8 3 2 6 7 0 1 0
3 2 2 7 1 3 7 1 0
4 2 5 9 8 9 4 1 0
5 2 8 5 3 3 8 1 1
6 7 7 7 5 6 9 0 0
7 3 9 5 3 6 7 0 1

Can this be done with Apply and a custom function? If executed as a loop, what is the most efficient way to reference the line in the inequalities?

Trigonometry – patterns in inequalities of the triangle with angles.

I read this page and wondered why, inequalities for $ sin A $ (with arguments $ A $) will have the same inequality for $ cos frac {A} {2} $ (with arguments $ frac {A} {2} $) and vice versa, similar for $ tan $ and $ cot $,

Examples

$$ sin frac {A} {2} sin frac {B} {2} sin frac {C} {2} le frac {1} {8} $$$$ cos A cos B cos C le frac {1} {8} $$

and

$$ cos (A) + cos (B) + cos (C) le frac {3} {2} $$$$ displaystyle sin frac {A} {2} + sin frac {B} {2} + sin frac {C} {2} le frac {3} {2} $$

Is there a bigger math or just a coincidence?

Inequalities – Logarithmic and polynomial functions with two roots

This is a question I came across a few days ago. Although this is not particularly a research problem, the following problem is that I examine the null distribution of a class of transcendental elementary functions. And I do not think the following problems are easy to handle. I have thought of her for a few days and they have all failed

if $ f (x) = x ^ 2-x- ln {x} – ln {a} $,and $ f (x_ {1}) = f (x_ {2}) = 0,0 <x_ {1} <x_ {2} $I suspected the roots $ x_ {1}, x_ {2} $ such
$$ dfrac {3} {2a + 1} <x_ {1} x_ {2} < dfrac { ln {a}} {a-1} $$

That's my attempt

since
$$ x ^ 2_ {1} -x_ {1} – ln {x_ {1}} = x ^ 2_ {2} -x_ {2} – ln {x_ {2}} = ln {a} $ $
To let $ x_ {2} = tx_ {1}, t> 1 $,Then we have
$$ x ^ 2_ {1} -x_ {1} – ln {x_ {1}} = t ^ 2x ^ 2_ {1} -tx_ {1} – ln {t} – ln {x_ {1} $$
$$ x_ {1} = dfrac {t-1 + sqrt {(t-1) ^ 2 + 4 ln {t} cdot (t ^ 2-1)}} {2 (t ^ 2-1 )} = f (t) $$
then
$$ x_ {2} x_ {1} = t (x_ {1}) ^ 2 = t left ( dfrac {t-1 + sqrt {(t-1) ^ 2 + 4 ln {t} cdot (t ^ 2-1)}} {2 (t ^ 2-1)} right) ^ 2 = t (f (t)) ^ 2 $$
and
$$ a = e ^ {x ^ 2_ {1} -x_ {1} – ln {x_ {1}}} = e ^ {f ^ 2 (t) -f (t) – ln {f (t )}} $$
it has to prove itself
$$ dfrac {3} {2e ^ {f ^ 2 (t) – f (t) – ln {f (t)}} + 1} le t (f (t)) ^ 21 $$The next thing I know is pretty complicated.

Inequalities – How to make $ a ^ n> -1 $ simpler to $ a> -1 $?

I'm not sure if your first premise is strict.

a ^ n> -1;

log[%[[1]]]> Log[%[[2]]]// PowerExpand
(* n log[a] > I π *)

%[[1]]/ n>%[[2]]/ n;

Exp[%[[1]]]> Exp[%[[2]]](* a> E ^ ((I π) / n) *)

a> (E ^ (I π)) ^ (1 / n)
(* a> (-1) ^ (1 / n) *)

table[{n, %}, {n, 1, 5}]
(* Larger :: north: Invalid comparison with I tried. *)
(* {{1, a> -1}, {2, a> I}, {3, a> (-1) ^ (1/3)}, {4, a> (-1) ^ (1 / 4)}, {5, a> (-1) ^ (1/5)}} *)

Now we can use for specific n reduce

eq = a ^ n> -1

table[Reduce[eq /. n -> b, a], {b, 1, 5}](* {a> -1, true, a> -1, true, a> -1} *)

It looks as if MMa would say for odd-numbered n a> -1, and for even n is the equivalent for each a, but a warning in the first part indicates that inequalities may not be valid when comparing complex numbers.

Inequalities – Why is Reduce in Mathematica the solution in other symbols that are not present in the original equation?

Here is an example:

To reduce[P/Q[P/Q[P/Q[P/Q< (P - X)/(Q - X) && X > 0 && P> 0 && Q> 0 && P> Q, {X}, integers]

The solution to the above equation is:

(C[1] | C[2] | C[3])[Element] Integers &&
C[1] > = 0 &&[2] > = 0 &&
C[3] > = 0 && P = 3 + C[1] + C[2] + C[3] &&
Q == 2 + C[1] + C[2] &&
X = 1 + C[2]

How do I interpret it? What is C and why are the numbers 1, 2 and 3 in brackets? The Reduction documentation does not use this notation in any of the examples. https://reference.wolfram.com/language/ref/Reduce.html

Inequalities – Find the maximum of $ f (x) $

The following problem is due to a problem that I encountered while studying inequality. I find it hard to prove

To let $ n $ give positive integer,$ (n ge 2) $,and
$$ f (x) = (nx) ln {(n + x + 1)} – (nx) ln {(nx)}, 0 le x le n-1, x in N ^ {+ $$
Find the maximum of $ f (x) $,from where $ x $ be positive integers.

since
$$ f & # 39; (x) = ln { left ( dfrac {n-x} {n + x + 1} right)} + dfrac {2n + 1} {n + x + 1} $$

I suspect when $ x = lfloor dfrac {n + 1} {2} rfloor $ is maximum